My React native expo application crashing without any error when call function() in withTiming() callback
example :
const whenFinishFunction = () => {
// do some thing
};
const [animationState, setAnimationState] = useState(false);
progress.value = withTiming(1,{duration: 200},
() => {
whenFinishFunction();
setAnimationState(false);
}
);
solved by use runOnJS
like :
progress.value = withTiming(1,{duration: 200},
() => {
runOnJS(setAnimationState)(false);
runOnJS(whenFinishFunction)();
}
);