> In short, a closure is like a semi-permeable box, letting information from the outside get in but never leaking anything out.
This is just wrong. For example:
const counter = () => { let count = 1; return () => count++ }
This is just wrong. For example:
const counter = () => { let count = 1; return () => count++ }
(see also: the JS pattern of using closures to create objects with truly private "fields")
State lives in a "global" and the component is modifying it. So it's "leaking info out".
It's hard to make comprehensive mental models that cover all the bases and leaves nothing out