computerjazz / react-native-draggable-flatlist

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

Getting error : Requring Module .... invariant violation : new nativeEventEmitter() #392

Open ADLsourceCode opened 2 years ago

ADLsourceCode commented 2 years ago

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>

    );
  };

simulator_screenshot_A2EC286F-DF82-4A01-B3B7-6952C27695D4

computerjazz commented 2 years ago

haven't seen that error before, but can you try upgrading to v3?

ADLsourceCode commented 2 years ago

@computerjazz Similar error with V3 . any specific version you want me to do ?

ucheNkadiCode commented 2 years ago

Getting same error with "react-native": "~0.63.4", and "react-native-draggable-flatlist": "^3.1.2"

bradjin8 commented 1 year ago

Getting same error with react-native 0.70.4, and the library ^3.1.2

bradjin8 commented 1 year ago

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>; }