DEV Community

Discussion on: Avoiding useEffect with callback refs

Collapse
 
tkdodo profile image
Dominik D

You're right, it will run once with null for the previous node, and then once more with the new node.

There are apparently some plans to "fix" callback refs by allowing them to return a cleanup function like useEffect does: twitter.com/dan_abramov/status/155...