我目前正在尝试首先将React-Native版本从0.55.3
升级到0.57.0
。
但是我目前在.babelrc
配置上遇到问题,我想...
我遇到此错误:
Failed to load bundle with error: Support for
the experimental syntax 'decorators-legacy'
isn't currently enabled (78:1):
这里是发生错误的文件,但这是语法错误,可能是因为我忘记了一些东西...
@connectActionSheet
| ^
| class MyClass extends Component<*, Props, State> {}
我的旧.babelrc文件
{
"presets": [
"react-native",
"react-native-stage-0/decorator-support"
],
"ignore": "false",
"env": {
"development": {
"sourceMaps": "inline"
}
},
"plugins": [
"syntax-class-properties",
"transform-class-properties",
"transform-object-rest-spread",
"lodash",
[
"module-resolver",
{
"root": [
"./App"
],
"alias": {
"~": "./App"
}
}
]
]
}
我的新人:
{
"presets": [
"module:metro-react-native-babel-preset"
],
"env": {
"development": {
"sourceMaps": "inline"
}
},
"plugins": [
"syntax-class-properties",
"transform-class-properties",
"transform-object-rest-spread",
"lodash",
[
"module-resolver",
{
"root": [
"./App"
],
"alias": {
"~": "./App"
}
}
]
]
}