当我尝试在 ios-simulator 上构建我的应用程序时,它说:
捆绑失败:SyntaxError:/Users/MyName/MyApp/node_modules/react-native/node_modules/react-native/Libraries/Components/Switch/Switch.js:支持实验性语法nullishCoalescingOperator
目前尚未启用 (167:52):
165 | {...props}
166 | {...platformProps}
> 167 | accessibilityRole={props.accessibilityRole ?? 'button'}
| ^
168 | onChange={this._handleChange}
169 | onResponderTerminationRequest={returnsFalse}
170 | onStartShouldSetResponder={returnsTrue}
Add @babel/plugin-proposal-nullish-coalescing-operator (https://git.io/vb4Se) to the 'plugins' section of your Babel config to enable transformation.
我按照它说的做了,但没有帮助......
任何帮助将不胜感激。
我认为通过将我的 .babelrc 更改为
{
"presets": ["module:metro-react-native-babel-preset"]
}
这个变化是由于升级我的react-native版本引起的
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)