React Native 错误:导出命名空间应首先通过 `@babel/plugin-proposal-export-namespace-from 进行转换

Avi*_*h A 12 javascript reactjs babeljs react-native

当我使用运行反应本机应用程序时出现以下错误react-native-cli

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`.
Run Code Online (Sandbox Code Playgroud)

我附上了我的系统配置中遇到的错误的屏幕截图 在此输入图像描述

系统配置 在此输入图像描述

小智 20

尝试这个: -

  1. npm install react-native-reanimated

  2. 在 babel.config.js 中插入插件:['react-native-reanimated/plugin'](确保它在最后,它应该看起来像这样:-

    module.exports = { 预设:['模块:metro-react-native-babel-preset'],插件:['react-native-reanimated/plugin'], };

  3. 运行react-native start --reset-cache

  4. 运行您的本机应用程序(例如 ios - npx react-native run-ios)