【发布时间】:2017-12-21 08:25:33
【问题描述】:
该项目是使用 create-react-native-app 创建的。
当我使用像const a = 2 ?? 3 这样的代码时,会报错“Cannot read property 'loose' of undefined”。
我尝试添加 @babel/plugin-proposal-nullish-coalescing-operator 插件,但出现构建错误。
.babelrc
{
"presets": ["babel-preset-expo"],
"env": {
"development": {
"plugins": ["transform-react-jsx-source"]
}
},
"plugins": ["@babel/plugin-proposal-nullish-coalescing-operator"]
}
【问题讨论】:
标签: javascript react-native babeljs expo create-react-native-app