interface ColorThemes {
DEFAULT: string,
DARK: string,
}
const colorThemes: ColorThemes = {
DEFAULT: "default",
DARK: "dark",
}
return (
<div>
{Object.keys(colorThemes).map(key =>
<div>{colorThemes[key]}</div>
)}
</div>
)
I'm trying to loop through an enum of strings. But visual studio intellisense complains and says:
Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'xxx'.
No index signature with a parameter of type 'string' was found on type 'xxx'.
Any help would be appreciated.
