-
-
Notifications
You must be signed in to change notification settings - Fork 23
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
When a React element receives a different ref on re-renderer the previous ref is updated to null and the new one is given the current value — regardless of changes in value.
I made a small CodeSandbox to verify this. In it you can also find a “solution”, which is to transform the API into an hook. This let us introduce useCallback to give the user a referentially stable ref.
This doesn’t solve the problem completely: if one of the refs changes all other refs receive a double (and useless) update too.
Grsmto, theKashey, bogdansoare, oliviertassinari, mdugue and 4 more
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working