2

this is my code:

  const setIngredient = useCallback(() => {
    setState({
      ...state,
      [ingredient]: Math.max(...Object.values(state)) + 1,
    });
  }, [state, ingredient, setState]);
  const onGestureEvent = useAnimatedGestureHandler({
    onActive: ({translationX, translationY}) => {
      translateX.value = translationX;
      translateY.value = translationY;
    },
    onEnd: ({velocityY}) => {
      const destination = snapPoint(translateY.value, velocityY, [
        0,
        -HEADER_HEIGHT,
      ]);
      translateX.value = withTiming(0);
      translateY.value = withTiming(0, {}, () => {
        opacity.value = 1;
      });
      if (destination !== 0) {
        opacity.value = 0;
        runOnJS(setIngredient)();
      }
    },
  });

i am not really sure why my app in android and ios just suddenly closes when runOnJS is fired, on both terminal in ios and android, there's no error, and i can't seem to find answers in Google atm. please help. Thanks. On my ios log, i have this:

(UIKitApplication:org.reactjs.native.example.rnPizzaAnimated[dd03][rb-legacy][31448]): Service exited due to SIGBUS | sent by exc handler[31448]

gpbaculio
  • 5,693
  • 13
  • 60
  • 102

0 Answers0