Reanimated 2 failed to create a worklet, maybe you forgot to add Reanimated's babel plugin?, js engine: hermes

Viewed 822

i have a promblem with React-native-Reanimated.
I received "Reanimated 2 failed to create a worklet, maybe you forgot to add Reanimated's babel plugin?, js engine: hermes" But I've already followed https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation enter image description here

Here is my version in reanimated:

"react-native-reanimated": "^2.3.0"

Here is my babel.config.js

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

Please help me to solve this problem. Thank you very much

1 Answers

If you are using expo, instead of installing using npm use:

expo install react-native-reanimated

In the babel.config.js use it like this:

module.exports = function(api) {
  api.cache(true);
  return {
    presets: ['babel-preset-expo'],
    plugins: ['react-native-reanimated/plugin'],
  };
};
Related