I am facing an issue in react-navigation-drawer
.
"react-native-gesture-handler": "^1.0.16",
"react-navigation": "^3.3.2"
This two version is installed. A drawer is working properly in Android and iPhone 5S. But, when I ran the app in iPhone X, it's throw error when I open drawer through gesture.
Unsupported top level event type "onGestureHandlerStateChange" dispatched
with gesture handlers, the handlers need to be mounted under a single GestureHandlerRootView . So it's important to keep the GestureHandlerRootView as close to the actual root view as possible.
React Native Gesture Handler enables you to implement highly performant gestures in React Native because it runs in the native thread and follows platform-specific behavior, which in turn leads to better performance.
From this react-native-gesture-handler
issue comment by balthazar:
Because my navigators were created asynchronously, the handler was registered too late and thus throwing this error. I fixed the issue by simply doing:
import 'react-native-gesture-handler';
at the top of my
index.js
🙂
By index.js
, balthazar is referring to your app's entrypoint – but I guess that the important thing is that it is imported before your first usage of react-native-gesture-handler
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With