tarasvakulka / react-native-cards-swipe

Card Stack Swiper implemented with Reanimated 2 and React Native Gesture Handler
MIT License
57 stars 15 forks source link

Failed to initialize react-native-reanimated library #15

Open ghost opened 1 year ago

ghost commented 1 year ago

Error: Failed to initialize react-native-reanimated library, make sure you followed installation steps here: https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/

also try :npm start -- --reset-cache

"react-native-reanimated" : '2.11.0' "react-native-cards-swipe": "^1.2.1", babel.config.js const alias = {'^@/(.+)': './src/\1'}; // @/folder will be an alias to /src/folder const extensions = ['.android.js', '.ios.js', '.js', '.json', '.native'];

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

Tahmid11 commented 1 year ago

Hi, were you able to fix this error? I am also experiencing issues too.

rein96 commented 1 year ago

You need to install react-native-reanimated properly by following the guide, I guess you miss these steps

Step 2: Add Reanimated's babel plugin Add react-native-reanimated/plugin plugin to your babel.config.js.

  module.exports = {
    presets: [
      ... // don't add it here :)
    ],
    plugins: [
      ...
      'react-native-reanimated/plugin',
    ],
  };

Step 3: Clear cache (recommended) yarn start --reset-cache

Reference: https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started/#step-2-add-reanimateds-babel-plugin