0

I'm using react-native-reanimated, and the I have an iOS crash when use this prop Animated.useCode

the full code of my prop body is here :

  Animated.useCode(
() =>
  Animated.onChange(
    callbackNode.current,
    Animated.block([
      Animated.cond(
        Animated.greaterThan(callbackNode.current, 0),
        Animated.call([], () => {
          onCloseBottomSheet && onCloseBottomSheet();
        }),
      ),
      Animated.cond(
        Animated.eq(callbackNode.current, 0),
        Animated.call([], () => {
          onFullScreen && onFullScreen();
        }),
      ),
    ]),
  ),
[onCloseBottomSheet, onFullScreen],);

when comment this prop the app return work and the crash disappear

the output of the crash from Xcode is:

Thread 1: "-[REASetNode beginContext:prevCallID:]: unrecognized selector sent to instance 0x6000014d0410".

can any body help me to solve this or if any have this before.

Qasem M. Zreaq
  • 139
  • 1
  • 1
  • 10

1 Answers1

0

Did you add the babel plugin to your babel.config.js. More info here (https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation)

Reanimated plugin has to be listed last.

  module.exports = {
      ...
      plugins: [
          ...
          'react-native-reanimated/plugin',
      ],
  };
carlosdafield
  • 1,479
  • 5
  • 16