6 ms·
Well, with React you can "opt in" when searching by simply adding "hooks" to the search term. Such wasn't possible with Angular back then
by NewsAware 7y ago
Well, with React you can "opt in" when searching by simply adding "hooks" to the search term. Such wasn't possible with Angular back then
- pier25 7y agoSince the majority of the community will probably be using hooks from now on it will be assumed that is the default React methodology which will break books, talks, blog posts, SO answers, etc.
- ng12 7y agoYou can mix-and-match. If you want to write an individual component as a class you can, and if you want to later convert it to using hooks there's nothing stopping you.
- pier25 7y agoThat's not the point. The point is that most of the React literature available today will become obsolete.
- ng12 7y agoHow? It's still perfectly valid, usable, idiomatic React.
- pier25 7y agoIf you learned React with hooks the class notation won't make sense, and viceversa.
- ng12 7y agoSo they should have renamed the whole framework when they added a single a new feature so people know they need to learn it before reading the examples?
- pier25 7y agoIt's not a new feature it's a complete new methodology.
- ng12 7y agoThat's quite hyperbolic. Functional components have existed in React for a long time, hooks are just adding existing concepts (state and lifecycle operations) to them.
- pier25 7y agoWe will have to agree to disagree. IMO the compositional paradigm of hooks is radically different than using classes for example.
- root_axis 7y agoThe point is that you don't have to use it. If you can't be bothered to learn a simple new feature then just keep doing it the old way; your code will still work. I don't even understand the complaint; are they never supposed to change anything? It's totally optional; even if most of the community goes down that direction you don't have to. Beyond that, hooks are super simple and the complainers are just making a big deal out of nothing. They are just callback functions that you implement outside of a class instead of overloading arbitrary method identifiers like "componentDidUpdate". You also don't have to use it.
- BigJono 7y agoThis is what I don't get about hooks. Remembering Markbages great talk on 'Minimal API Surface Area'? How is having multiple ways of doing the same thing minimal API surface area? React is losing sight of what made it great when it came out. Do one thing, do it well, and do it the simplest way possible.
- thatswrong0 7y agoThat sort of absolutist logic will never allow a framework to progress and become better. Sometimes good ideas come around (IMO like hooks) that are worth increasing the API surface area for. I for one loathe using class components now and not being able to share logic compositionally via hooks when I work with them. I feel more productive and I feel like my components are smaller and more focused, and I don’t repeat myself as much. It’s been a net win for me, and I think it’s well worth having two supported APIs that do roughly the same thing.. because despite this, React is still a small and focused library API-wise.
- ng12 7y agoThey've increase the surface to reduce it over time, if that makes sense. Hooks are much more natural, simplistic way to write stateful components.