TypeScript TS7015 error when accessing an enum using a string type parameter

前端 未结 4 1984
执笔经年
执笔经年 2020-12-02 16:50

I am new to TypeScript and I don\'t understand the what I need to do to fix the line that generates the TS7015 error (referencing an enum member using a string variable) bec

4条回答
  •  旧时难觅i
    2020-12-02 17:19

    You can prevent this error with the compiler option without loosing the whole strict null checks

    "suppressImplicitAnyIndexErrors": true
    

提交回复
热议问题