> the major complaint I have about hooks, which is that it's no longer Javascript
Are you saying that hooks are implemented in a way that needs a compiler (e.g. like CoffeeScript or TypeScript) for them to work? I've always assumed they were implemented using closures or a similar pattern.
It is JavaScript, but it doesn't feel like JavaScript. What looks like a pure function isn't actually, and can do a different thing depending on where and when you run it, all hidden in some magic within the React library.
JS is one of the most un-opinionated, flexible language around, I do not believe there is a one true way™ of doing JS. For example, React and Angular have very different approaches (functional vs OPP) on how to JS.
I do agree that having something do a different thing depending on where and when can be counter-intuitive.
Meaning that instead of using existing JavaScript structures to provide instance state, it's re-implemented in an abstruse way that creates a whole bunch of constraints on your code and new rules to keep in your head at at all times that are react-with-hooks-specific.
Are you saying that hooks are implemented in a way that needs a compiler (e.g. like CoffeeScript or TypeScript) for them to work? I've always assumed they were implemented using closures or a similar pattern.