3 ms·
I don't think new paradigms are a bad thing, I think the problem with hooks is that they are a "clever trick" to work around the fact that the language/runtime
by danpalmer 3y ago
I don't think new paradigms are a bad thing, I think the problem with hooks is that they are a "clever trick" to work around the fact that the language/runtime does not have the necessary features to support the developer experience that they would ideally have.
What's sad is that the class-based component system did have those necessary features, it also had a nice distinction between components and their lifecycle and the rest of your code. Now with hooks, everything is React lifecycle code, unless you're really smart about your API boundaries, and in my experience no one makes good re-usable hooks that are nicely isolated from business logic.
- drewcoo 3y ago> they are a "clever trick" to work around the fact that the language/runtime does not have the necessary features to support the developer experience that they would ideally have I'd call that a pretty good definition of a "design pattern." In this case, it's also magic framework code.
- danpalmer 3y agoHooks are a design pattern, but I disagree that hacks around languages are a definition of a design pattern. What makes you feel they are?