'React' was used before it was defined

前端 未结 14 2103
傲寒
傲寒 2020-12-29 19:28

I am working with create-react-app + typescript + eslint application and during build have such error:

Line 1:8:  \'React\' was used before it was defined  @t         


        
14条回答
  •  -上瘾入骨i
    2020-12-29 20:04

    It is an issue present in ESLINT.

    The way I resolve is to add the following lines to the ESLINT/rules:

    "no-use-before-define": [0],
    "@ typescript-eslint / no-use-before-define": [1],

提交回复
热议问题