-
-
Notifications
You must be signed in to change notification settings - Fork 992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expo app crashes when using GestureDetector #2846
Comments
Hi @Ever-It-Lazy! Thanks to expo team I was able to identify what causes this problem. The error here was missing I've also made some adjustments in your code: App.js<Stack.Screen name="GestureScreen" component={GestureScreen} /> You don't have to use GestureScreen.jsexport default function StartScreen({ navigation }) {
const doubleTap = Gesture.Tap()
.numberOfTaps(2)
.onEnd(() => {
navigation.navigate("OtherScreen");
})
.runOnJS(true);
return (
<GestureHandlerRootView style={styles.container}>
<GestureDetector gesture={doubleTap}>
<View style={styles.button}>
<Text style={styles.buttonLabel}>
Double Tap to go to the other screen
</Text>
</View>
</GestureDetector>
</GestureHandlerRootView>
);
} Here I've changed few things:
So overall, to get rid of this problem you have to add |
That solved it. Thanks for the other best practices suggestions, as well! |
Hi, I'm facing the same issue with my app ( I made a sample project using same stack (without Expo) to reproduce the issue with a simple case and the app crash on view using the Here is the sample app => https://github.com/Under-Warz/rngh_sample/blob/main If anyone have an idea ? PS : I can't update our app to |
Hi @Under-Warz! I've just run your sample app on both, Android emulator and iOS simulator - both work fine. Moreover, there's no need to add |
thank's @m-bert for you test. Could you give me your version of xcode & ios you are using for the test ? I can't understand why it's crashing here... The only log message from Xcode when the app crash is
|
@m-bert just to be sure, did you install the pods with |
I've checked that on old architecture, but I will look into it
I've just got Xcode update to version 15.4 and iOS to 17.5, I'll check if it still works for me (also on new arch) and get back to you |
I've just realized that I missed I've also noticed that even with a quick fix, your app crashes on hot reload because of |
Thank's for your investigation @m-bert. We've planned to update RN 0.74 & Expo 51 next week. |
Description
I am coding an Expo app that uses
@react-navigation/native-stack
for navigation andreact-native-gesture-handler
to track gesture on one screen. It loads fine, but completing theGesture.Tap()
(which should navigate to another screen) crashes Expo.(This issue bares a vague resemblance to 2840, but I've investigated: they appear to be different.)
Steps to reproduce
I provide a repo as a simple example.
NavigationContainer
for 2 screens.Gesture.Tap()
example.Snack or a link to a repository
https://github.com/Ever-It-Lazy/gesture_example
Gesture Handler version
2.14.0
React Native version
0.73.6
Platforms
iOS
JavaScript runtime
None
Workflow
Expo managed workflow
Architecture
None
Build type
None
Device
iOS simulator
Device model
iPhone X (iOS 16.7.7)
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: