Deep dive: How do React hooks really work? | Netlify
In this article, we reintroduce closures by building a tiny clone of React Hooks. This will serve two purposes - to demonstrate the effective use of closures in building our React Hooks clone itself, and also to implement a naive mental model of how Hooks work under the hood. Finally, we arrive at how Custom Hooks naturally arise.
netlify.com