DEV Community

Discussion on: React is finally JavaScript

mindplay profile image
Rasmus Schultz

I disagree that hooks are "functional composition well executed".

The engine internally counts calls to establish the identity of individual states and effects - it requires a custom linter to validate that valid JavaScript is also valid React.

To me, this goes against the idioms of the language - it's an attempt to make something that evokes feelings of pure functional composition, when in fact it's largely a language "hack".

I find it by all means far more unnatural and further from the language than classes.

Not saying that classes are or were a great way solve these problems, but at least it was leveraging the language rather than trying to subvert it.

I hope we'll see more UI frameworks in the future that really compose functions - without the hacks - the way React hooks appear to do until you understand what's really going on beneath the hood. 😐