computerjazz / react-native-draggable-flatlist

A drag-and-drop-enabled FlatList for React Native
MIT License
1.88k stars 389 forks source link

ERROR Error: GestureDetector 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. #536

Open Jidahan opened 2 months ago

Jidahan commented 2 months ago

After introduction, the page directly reports an error

Platform & Dependencies Please list any applicable dependencies in addition to those below (react-navigation etc).

Additional context Add any other context about the problem here.

Jidahan commented 2 months ago

resolved! use GestureHandlerRootView include DraggableFlatList


 import {GestureHandlerRootView} from 'react-native-gesture-handler';

  <GestureHandlerRootView style={{flex: 1}}>
    <DraggableFlatList
      style={{backgroundColor: '#f5f5f5', width: '100%'}}
      data={data}
      keyExtractor={item => item.id}
      renderItem={({item, drag, isActive}) => (
        <Text>123</Text>
      )}
    />
  </GestureHandlerRootView>
HarshDev2 commented 2 months ago

Thanks @Jidahan, I had the same issue, and this solved it for me.