5

I wanted to use react-native-router-flux so i added its dependencies as described in its documents. I also added babel plugin dependency for react-native-reanimated in babel.config.js as below:

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

But now im getting this error in metro server:

error: index.js: Cannot find module 'react-native-reanimated/plugin' from '/home/nia/Downloads/YarAb'

my react-native version is 0.63.2

b.andarzian
  • 53
  • 1
  • 1
  • 7

2 Answers2

3

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

yarn add react-native-reanimated

npm start -- --reset-cache

expo start -c

worked for me

dbc
  • 104,963
  • 20
  • 228
  • 340
Rom
  • 31
  • 2
2

unfortunately, expo sdk v38 doesn't support reanimated v2 yet, because "reanimated 2 only supports hermes at the moment".

this problem is also documented in the react-native-reanimated v2 docs: "expo support is not ready yet, next sdk release will support react native 0.62 – this will allow you to use reanimated 2 in the ejected expo app."

the only solution for the moment is to either eject your expo app in order to use reanimated, or look for alternatives, like react-native-animatable.

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