Why do we need Ref Callbacks in React?
⏱️Timestamps:
00:00 - RefObject vs RefCallback
00:58 - When useEffect might not work
02:56 - Why using effect is a wrong tool for DOM Logic synchronization
04:06 - Fixing referential stability for Ref Callbacks
06:28 - Cleanup Functions for Ref Callbacks
📖 Acknowledgments and further reading:
Ref Callbacks Cleanup Function:
Merged RFC: https://github.com/facebook/react/pul...
When it will be published: https://github.com/facebook/react/iss...
Other:
https://legacy.reactjs.org/docs/refs-...
https://legacy.reactjs.org/docs/refs-...
https://react.dev/reference/react/use...
https://legacy.reactjs.org/docs/hooks...
https://tkdodo.eu/blog/avoiding-use-e...
https://julesblom.com/writing/ref-cal...
https://thoughtspile.github.io/2021/0...
/ usecallback-might-be-what-you-meant-by-use...
https://blog.maisie.ink/react-ref-aut...