For years now I wrote my data bags like this.
export inteface Foo {
bar: {
[key: string]: string;
};
}
To be honest, I always felt kind of disgusted about it...
But today, I learned the elegant way.
export interface Foo {
bar: Record<string, string>
}
May the elegant code be with you my coding friends!
Top comments (0)