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

The solution for “ts enum string’ can’t be used to index type” can be found here. The following code will assist you in solving the problem.

enum Enum {
some = ‘some text here’,
other = ‘other stuff here’
}

(Object.keys(Enum) as Array).map(x => {
console.log(TagEnum[x])
// Element implicitly has an ‘any’ type because expression of type ‘string’ can’t be used to index type ‘typeof TagEnum’.
// No index signature with a parameter of type ‘string’ was found on type ‘typeof TagEnum’.
})

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in