在/ projectFolder

问题描述

我想使用react-native-router-flux,所以我按照文档中的描述添加了它的依赖项。我还在react-native-reanimated中为babel.config.js添加了babel插件依赖项,如下所示:

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

但是现在我在Metro服务器中收到此错误

错误:index.js:无法从“ / home / nia / Downloads / Yarab”中找到模块“ react-native-reanimated / plugin”

我的本​​机版本是0.63.2

解决方法

很遗憾,expo sdk v38尚不支持复活的v2,因为"reanimated 2 only supports hermes at the moment"

react-native-reanimated v2 docs中也记录了此问题:“ expo支持尚未准备好,下一个sdk版本将支持react native 0.62 –这将允许您在弹出的菜单中使用reanimated 2博览会应用。”

目前唯一的解决方案是弹出您的expo应用程序以使用已恢复动画的应用程序,或者寻找alternatives,例如react-native-animatable

https://github.com/software-mansion/react-native-reanimated/issues/886