清颖7339383
2019-09-21 17:40
安装了两个依赖包,也设置了.babelrc,使用@时,运行报错Support for the experimental syntax 'decorators-legacy' isn't currently enabled,找了百度的解决方法,添加
"plugins": [
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
]
],不可解决。。请问怎么回事啊??
这个插件不是添加在 .babelrc
需要添加在 package.json 中。
"babel": {
"presets": [
"react-app"
],
"plugins": [
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
]
]
},React高级教程之高阶组件
14472 学习 · 34 问题
相似问题