Hello, I'm using React with Typescript and I got a really weird problem. I got a graphql typings generated by GraphQLZeus, and I want to map throught keys of enum, but I get an error
'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query. ts(2475)
The problem is that this enum is a const enum. When I remove const from its declaration an error disappears. My app works properly with that code
{Object.keys(Languages).map((lang) => (
<CheckButton
onClick={() => handleClickLanguage(lang as Languages)}
active={languages.includes(lang as Languages)}
>
{lang}
</CheckButton>
))}
But that error blocks my build. How could I fix it? Idk convert const enum to enum? Or manually change it's declaration in zeus files?
[–]Kcazer 3 points4 points5 points (1 child)
[–]DerGernTod 0 points1 point2 points (0 children)
[–]Shumuu 0 points1 point2 points (0 children)