babel 7 Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead

前端 未结 3 1552
被撕碎了的回忆
被撕碎了的回忆 2021-01-18 00:36

I\'m using react js with latest babel 7. when I use decorators of mobx I get the error

Parsing error: Using the export keyword between a decorator and a class is not

3条回答
  •  北荒
    北荒 (楼主)
    2021-01-18 00:43

    Instead of changing the import statements across your project, you could use the legacyDecorators option in your .eslintrc file.

    {    
      "parserOptions": {
         "ecmaFeatures": {
           "legacyDecorators": true
         }
       }
    }
    

提交回复
热议问题