Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: ref.measureLayout must be called with a node handle. #543

Open
Krishna2323 opened this issue Jul 21, 2024 · 0 comments
Open

Warning: ref.measureLayout must be called with a node handle. #543

Krishna2323 opened this issue Jul 21, 2024 · 0 comments

Comments

@Krishna2323
Copy link

Describe the bug

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.

const nodeHandle = findNodeHandle(scrollableRef.current);

containerRef.current.measureLayout(nodeHandle, onSuccess, onFail);

Demo

340080842-d9cafd74-479f-4ec5-abfa-7cc51a51138e.mp4

Platform & Dependencies
Please list any applicable dependencies in addition to those below (react-navigation etc).

  • react-native-draggable-flatlist version: "^4.0.1"
  • Platform: Android
  • React Native or Expo version: "0.73.4"
  • Reanimated version: "^3.8.0"
  • React Native Gesture Handler version: "2.14.1

Additional context
Discussion in react-native-web

@Krishna2323 Krishna2323 changed the title Warning: Warning: ref.measureLayout must be called with a node handle. Warning: ref.measureLayout must be called with a node handle. Jul 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant