Important little nuance here about callback ref's cleanup function in React 19. If you are assigning a ref object in a callback ref and you decide to add a cleanup function, make sure you re-assign the ref during cleanup.
4 reposts43 likes
Important little nuance here about callback ref's cleanup function in React 19. If you are assigning a ref object in a callback ref and you decide to add a cleanup function, make sure you re-assign the ref during cleanup.
4 reposts43 likes
Yah, I appreciated @tkdodo.eu’s mention of this in his blog. I’d love to say this shouldn’t make a huge difference in app code but…I’ve seen app code
I had trouble understanding this so I wrote an example of the problem as I understand it in a CodeSandbox: codesandbox.io/p/sandbox/ke...