3

I have tried all I can think of to fix this error. I have tried uninstalling reanimated-bottom-sheet and react-native-reanimated and reinstalling them. Clearing cache. I do not have a babel.config.js file that I am aware of to edit. I know the error comes from this exact import below.

import BottomSheet from 'reanimated-bottom-sheet';

I have also linked a repository in order to reproduce my exact issue here. I added my node_modules just in case, I am not sure if it would help someone see what I was doing wrong or not.

Justin Priede
  • 444
  • 6
  • 30

4 Answers4

3

You need to add babel.config.js in root directory of the project (near package.json) with following context (or just grab it from https://github.com/software-mansion-labs/reanimated-2-playground):

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

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

Sergey Zhukov
  • 714
  • 6
  • 5
0

I added 'react-native-reanimated/plugin' to babel.config.js - but I had also .babelrc... stay with only one of them...

chenop
  • 4,743
  • 4
  • 41
  • 65
0

__reanimatedWorkletInit function and __worklet property have been removed in react-native-reanimated@2.7.0.

Check reanimated releases https://github.com/software-mansion/react-native-reanimated/releases.

In my case i just downgraded to react-native-reanimated@2.6.0 and it worked fine

Aeo-dev
  • 1
  • 1
0

If using expo, use

expo install react-native-reanimated react-native-gesture-handler

instead of

yarn add react-native-reanimated react-native-gesture-handler

and then exit server then run expo r -c This worked for me.

Israël Mekomou
  • 115
  • 2
  • 5