[英]React Native error: Export namespace should be first transformed by `@babel/plugin-proposal-export-namespace-from
I am getting the following error when I am running react native application using react-native-cli
当我使用
react-native-cli
运行 react native 应用程序时出现以下错误
error: node_modules\react-native-reanimated\src\index.ts:
D:\Desktop\coding\Github\Stocksy\node_modules\react-native-reanimated\src\index.ts:
Export namespace should be first transformed by `@babel/plugin-proposal-export-namespace-from`.
I am attaching the screenshot of error I am getting with my system configuration我附上了我的系统配置错误的屏幕截图
Try this: -尝试这个: -
npm install react-native-reanimated
In babel.config.js insert plugins: ['react-native-reanimated/plugin'] (make sure its at the end, it should look like this: -在 babel.config.js 中插入插件: ['react-native-reanimated/plugin'] (确保它在最后,它应该看起来像这样:-
module.exports = { presets: ['module:metro-react-native-babel-preset'], plugins: ['react-native-reanimated/plugin'], }; module.exports = { 预设:['module:metro-react-native-babel-preset'],插件:['react-native-reanimated/plugin'],};
run react-native start --reset-cache运行 react-native start --reset-cache
run your native app (For ios example - npx react-native run-ios)运行您的本机应用程序(例如 ios - npx react-native run-ios)
What you have to do is add this config to your babel.config.js and restart your app.您需要做的就是将此配置添加到您的babel.config.js并重新启动您的应用程序。 plugins: ['react-native-reanimated/plugin'],
插件:['react-native-reanimated/plugin'],
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.