Expo + android: Items aren't dragging
See original GitHub issueIssue Description
Hello,
I have a managed expo project and am trying to use this package. I have followed the installation instructions as stated for expo here and here: https://docs.expo.dev/versions/latest/sdk/reanimated/ https://docs.expo.dev/versions/latest/sdk/gesture-handler/
I’m not able to drag the items in my list. I added a ScaleDecorator wrapper to check that the drag gets triggered, and the item does rescale, but I’m unable to drag it.
const renderItem = ({ item, index, drag, }: any) => ( <ScaleDecorator> <TouchableOpacity onLongPress={drag} style={styles.draggable}> <Text>{item?.label}</Text> </TouchableOpacity> </ScaleDecorator> );
EDIT: sorry the code is not formatting properly for some reason, I don’t know how to fix it
To Reproduce Since I might have done something wrong, I even copied someone else’s working code and replaced my App.tsx with it, but I still get the same problem when I use the example code: https://snack.expo.dev/@bonehead06/react-native-draggable-flatlist-functional-component
The list renders but I can’t drag the items anywhere.
Platform & Dependencies Please list any applicable dependencies in addition to those below (react-navigation etc).
- react-native-draggable-flatlist version: ^3.0.5
- Platform: Developing in Windows / Android
- Expo version: ~44.0.0
- Reanimated version: ~2.3.1
- React Native Gesture Handler version: ~2.1.0
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:5 (1 by maintainers)
can you try wrapping your root in a
GestureHandlerRootView
? see https://github.com/software-mansion/react-native-gesture-handler/issues/1839Yes thank you, the fix for me was to wrap the app with
<GestureHandlerRootView style={{ flex: 1 }}>
.I think this issue can be closed