computerjazz / react-native-draggable-flatlist

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

Tried to modify key `current` of an object which has been already passed to a worklet. See #557

Open rohanthakran opened 1 week ago

rohanthakran commented 1 week ago

"react-native-reanimated": "^3.15.5", "react-native-gesture-handler": "^2.20.0", "react-native-draggable-flatlist": "^4.0.1",

[Reanimated] Tried to modify key current of an object which has been already passed to a worklet. See

https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#tried-to-modify-key-of-an-object-which-has-been-converted-to-a-shareable for more details.

This is the code <DraggableFlatList activationDistance={5} data={dragData} onDragEnd={({data}) => setDragData(data)} keyExtractor={item => item.key} renderItem={renderItemDrag} containerStyle={[{backgroundColor: 'pink'}]} />

const renderItemDrag = ({item, drag, isActive}: RenderItemParams) => { return (

{item.label}
);

};

const initialData = [ { label: '🍎 Apple', key: 'apple', backgroundColor: 'indianred', }, { label: '🍊 Orange', key: 'orange', backgroundColor: 'orange', }, { label: '🍌 Banana', key: 'banana', backgroundColor: 'yellowgreen', }, { label: '🍇 Grapes', key: 'grapes', backgroundColor: 'purple', }, ];

muneebaa commented 1 week ago

Same issue here this happens on TouchableOpacity in renderItem

stephentuso commented 4 days ago

Also ran into this after updating to reanimated 3.15.5 and react native 0.75