computerjazz / react-native-draggable-flatlist

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

fix: warning - ref.measureLayout must be called with a node handle. #544

Open Krishna2323 opened 3 months ago

Krishna2323 commented 3 months ago

Issue

When a new list item is added in NestableDraggableFlatList we get the warning Warning: ref.measureLayout must be called with a node handle or a ref to a native component.

This happens because we are using findNodeHandle and this PR in react-native now allows measureLayout to be passed a ref and throw the warning if node is passed.

https://github.com/computerjazz/react-native-draggable-flatlist/blob/ebfddc4877e8f65d5391a748db61b9cd030430ba/src/components/NestableDraggableFlatList.tsx#L51 https://github.com/computerjazz/react-native-draggable-flatlist/blob/ebfddc4877e8f65d5391a748db61b9cd030430ba/src/components/NestableDraggableFlatList.tsx#L60

Demo

https://github.com/user-attachments/assets/826bd37a-e34e-49f7-874b-8b18346714fe