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. 😐
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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. 😐