ts enum string 27 can 27t be used to index type

Solutions on MaxInterview for ts enum string 27 can 27t be used to index type by the best coders in the world

showing results for - "ts enum string 27 can 27t be used to index type"
Tim
16 Apr 2020
1enum Enum {
2    some = 'some text here',
3    other = 'other stuff here'
4}
5
6(Object.keys(Enum) as Array<keyof typeof Enum>).map(x => {
7	console.log(TagEnum[x])
8// Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'typeof TagEnum'.
9// No index signature with a parameter of type 'string' was found on type 'typeof TagEnum'.
10})
11