react-native-draggable-flatlist
react-native-draggable-flatlist copied to clipboard
Getting error : Requring Module .... invariant violation : new nativeEventEmitter()
Getting the below error After using "react-native-draggable-flatlist": "^2.6.2" with "react-native": "0.65.1". @computerjazz
Below is the code
<View style={{ flex: 1 }}>
<DraggableFlatList
data={filterList}
onDragEnd={({ data }) => {
console.log(data);
}}
keyExtractor={(item) => item.id.toString()}
renderItem={renderItem}
/>
</View>
const renderItem = ({ item, drag, isActive }: RenderItemParams<Service>) => {
return (
<TouchableOpacity
onLongPress={drag}
disabled={isActive}
style={[
{ backgroundColor: "red" },
]}
>
<ServiceItem
handleDelete={() => onDelete(item)}
data={item}
onPress={() => {
setSelectedService(item);
setOpen(true);
}}
/>
</TouchableOpacity>
);
};
haven't seen that error before, but can you try upgrading to v3?
@computerjazz Similar error with V3 . any specific version you want me to do ?
Getting same error with "react-native": "~0.63.4", and "react-native-draggable-flatlist": "^3.1.2"
Getting same error with react-native 0.70.4, and the library ^3.1.2
Getting same error with react-native 0.70.4, and the library ^3.1.2
After struggling with this issue for a day.
I found I skipped to do the configuration for the dependencies, reanimated
and gesture-handler
Especially, this issue was resolved after wrapping the app component by GestureHandlerRootView as the installation guide here.
export default function App() { return <GestureHandlerRootView style={{ flex: 1 }}>{/* content */}</GestureHandlerRootView>; }