I suffered for two days with a problem after adding reanimated - when I swiped, the application crashed (the buttons worked) Maybe someone will encounter this problem, here is the solution: add: runOnJS(true) const swipe = Gesture.Simultaneous( Gesture.Fling().runOnJS(true).direction(Directions.RIGHT).onStart(onBack), Gesture.Fling().runOnJS(true).direction(Directions.LEFT).onStart(onContinue) )
@notjustdev6 ай бұрын
Thanks for sharing!
@Shasa.t6 ай бұрын
Thank you for this, solved the issue for me!!
@ajalasegun110 ай бұрын
Thanks for DEVember!
@Wavywahid10 ай бұрын
My app crashes when I have Reanimated and try to swipe to left or right. Anybody else have this issue?
@priyamshah71179 ай бұрын
same error , how did you solve ? and could you figure out what actually is causing the error ?
@Wavywahid9 ай бұрын
@@priyamshah7117 you need to use `runOnJS` when calling an external function in gesture
@noormuhammad8887 ай бұрын
@@priyamshah7117 @Wavywahid . After 3 hours of debugging. I've debugged the issue. It is because the reanimated and gesture handler callbacks works on the UI thread and the onContinue and onBack function we have created are by default run on the JS thread, so we can not use it directly for some reason (idk why). Here is the solution: import Animated, { FadeIn, FadeOut, runOnJS } from "react-native-reanimated"; //swipeForward .onEnd(() => runOnJS(onHandleContinue)()); //swipeBackward .onEnd(() => runOnJS(exitOnboarding)());
@ot79767 ай бұрын
Had the same, i copied the day2 tsx files from the git repository (day 2 end branch) and all was ok. I couldbt see an obvious difference!
@АртёмГаджиев-к3э6 ай бұрын
I suffered for two days with a problem after adding reanimated - when I swiped, the application crashed (the buttons worked) Maybe someone will encounter this problem, here is the solution: add: runOnJS(true) const swipe = Gesture.Simultaneous( Gesture.Fling().runOnJS(true).direction(Directions.RIGHT).onStart(onBack), Gesture.Fling().runOnJS(true).direction(Directions.LEFT).onStart(onContinue) )
@usmaniCodes5 ай бұрын
hello Sir, whenever I change anything in day2 it goes back to home screen (re-renders) .. even though I change just fonts related setting .. meaning fontSize 5 to 10 .