React-MobX Error: The 'decorators' plugin requires a 'decoratorsBeforeExport' option, whose value must be a boolean

前端 未结 5 681
無奈伤痛
無奈伤痛 2021-02-12 11:52

I get the following error: If you are migrating from Babylon/Babel 6 or want to use the old decorators proposal, you should use the \'decorators-legacy\' plugin instead of \'dec

5条回答
  •  故里飘歌
    2021-02-12 12:33

    "babel": {
       "presets": [
         "react-app"
       ],
      "plugins": [
      [
        "@babel/plugin-proposal-decorators",
        {
          "legacy": true
        }
      ],
      [
        "@babel/plugin-proposal-class-properties",
        {
          "loose": true
        }
       ]
      ]
     },
     "devDependencies": {
     "@babel/plugin-proposal-decorators": "^7.3.0"
    }
    

提交回复
热议问题