App immediately crash using runOnJS?
See original GitHub issueapp closing immediately
Expected behavior
Actual behavior & steps to reproduce
Snack or minimal code example
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 }) => {
"worklet";
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)();
}
},
});
Package versions
- React Native: 0.64
- React Native Reanimated: 2.1.0
- NodeJS: v12.21.0
- Xcode: 12.5
- Java & Gradle:
Affected platforms
- [ x] Android
- [ x] iOS
- Web
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
App immediately crash using runOnJS? - Bountysource
app closing immediately. Expected behavior. Actual behavior & steps to reproduce. Snack or minimal code example.
Read more >runOnJS automatically closes app in react native without error ...
i am not really sure why my app in android and ios just suddenly closes when runOnJS is fired, on both terminal in...
Read more >App Center Crashes for React Native - Microsoft Learn
App Center Crashes provides you with an API to generate a test crash for easy testing of the SDK. This API can only...
Read more >runOnJS | React Native Reanimated - Software Mansion
When you call a function on the UI thread you can't be sure if you're calling a worklet or a callback from the...
Read more >React native app crash on review b… | Apple Developer Forums
I have tested the app on many real devices using test flight and also on simulators. Even I have tested on the same...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jmysliv updating react + reanimated fix
Hi @gpbaculio! Are you still encounter this issue? Have you tried to upgrade reanimated to
2.3.0-alpha.2?