@darrylyeo
Treat React Hooks for what it is – a separate programming language.
Hooks happen to use JavaScript-y syntax and package mechanisms, but they ignore all the usual conventions around references and closures due to the implied re-rendering loop and are thus incompatible with the rest of the JavaScript ecosystem.