Home > Software design >  React native drag and drop between flatlist
React native drag and drop between flatlist

Time:11-09

I have two flatlist consist of 5 and 10 items, i want to drag 1 item from first flatlist to second and vice verse , i have searched for many library but havent found any one yet.

CodePudding user response:

Hope this blog helps

React native : Drag and drop between two lists

CodePudding user response:

You can easily achieve this thing with react-native-draggable-flatlist

import DraggableFlatList, {
  ScaleDecorator,
} from "react-native-draggable-flatlist";

<DraggableFlatList
      data={data}
      onDragEnd={({ data }) => setData(data)}
      keyExtractor={(item) => item.key}
      renderItem={renderItem}
    />

Hope it will you!

  • Related