What the useEvent React hook is (and isn't)
typeofnan.dev
typeofnan.dev
I've been saying it since it came out, React Hooks was a HUGE mistake. It fractured the ecosystem into two completely different ways to use React.
Personally I find Hooks code much harder to comprehend. And this article is a perfect example of why even simple looking Hooks code comes with unintuitive behavior.
Someone needs to fork React, remove Hooks, and merge `componentDidUpdate` and `componentDidMount` into one function with a flag to determine if it's "on mount", so I don't have to keep calling `componentDidUpdate` from `componentDidMount`.
I've been using React at work for 8 years straight FWIW, and can't wait to use something else. I'd be happier using jQuery at this point