hossein-zare / react-native-dropdown-picker

A single / multiple, categorizable, customizable, localizable and searchable item picker (drop-down) component for react native which supports both Android & iOS.
https://hossein-zare.github.io/react-native-dropdown-picker-website/
MIT License
1k stars 297 forks source link

^5.4.7-beta.1 - Error: NativeViewGestureHandler must be used as a descendant of GestureHandlerRootView. Otherwise the gestures will not be recognized. See https://docs.swmansion.com/react-native-gesture-handler/docs/installation for more details. #725

Open sharathbangera6 opened 1 year ago

sharathbangera6 commented 1 year ago

I am getting following error when i use ^5.4.7-beta.1 Version - NativeViewGestureHandler must be used as a descendant of GestureHandlerRootView. Otherwise, the gestures will not be recognized. See https://docs.swmansion.com/react-native-gesture-handler/docs/installation for more details.

Can you please import GestureHandlerRootView from react-native-gesture-handler and Add it to the route of your component.

I edit Picker.js and added below code to route of this component and it works. Can you incorporate the same and update ? we will upgrade the package.


<GestureHandlerRootView style={{ flex: 1 }}> ... </GestureHandlerRootView>
sekoyo commented 1 year ago

Yep same issue too, my app is already wrapped in GestureHandlerRootView 🤔

sekoyo commented 1 year ago

This issue happens when yarn doesn't properly dedupe deps. Run npm ls react-native-gesture-handler

I had react-native-gesture-handler duped in react-native-dropdown-picker even though all my deps were using the same version and yarn claims it de-dupes.

In the end I just deleted yarn.lock and node_modules and reinstalled and de-duping worked properly

myproject
├─┬ @react-navigation/drawer@6.6.6
│ └── react-native-gesture-handler@2.13.4 deduped
├─┬ react-native-draggable-flatlist@4.0.1
│ └── react-native-gesture-handler@2.13.4 deduped
├─┬ react-native-dropdown-picker@5.4.7-beta.1
│ └── react-native-gesture-handler@2.13.4 deduped // before it wasn't deduped
└── react-native-gesture-handler@2.13.4
MussadiqAli commented 6 months ago

Just remove node_modules and yarn.lock, and yarn install. Problem is solved