【问题标题】:You may need an additional loader to handle the result of these loaders when using react-native-reanimated使用 react-native-reanimated 时,您可能需要额外的加载器来处理这些加载器的结果
【发布时间】:2022-11-10 12:49:18
【问题描述】:

我有一个使用 Expo 生成的 React Native 应用程序。当我安装react-native-reanimated 时,它给了我这个错误。我必须用它配置其他东西吗?

【问题讨论】:

  • 如果我的回答是正确的,你能接受吗?

标签: reactjs react-native expo babeljs metro-bundler


【解决方案1】:

将 react-native-reanimated 的 babel 插件添加到您的 babel.config.js 中,如其 official page 所述:

  module.exports = {
      ...
      plugins: [
          ...
          'react-native-reanimated/plugin',
      ],
  };

【讨论】:

  • 这个解决方案缺少的是插件必须是最后一个
【解决方案2】:

安装 react native 复活

expo install react-native-reanimated

【讨论】:

  • 为什么这行得通?
【解决方案3】:

这对我们有用

https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/

CAUTION
Reanimated plugin has to be listed last.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-04-05
    • 2020-12-04
    • 1970-01-01
    • 2020-09-12
    • 1970-01-01
    • 1970-01-01
    • 2022-11-06
    • 1970-01-01
    相关资源
    最近更新 更多