3 ms·
Yes, that's what the React team should have done when they implemented hooks.
by pier25 7y ago
Yes, that's what the React team should have done when they implemented hooks.
- zwily 7y agoWhy? Hooks are completely backwards compatible.
- pier25 7y agoWhat about books, talks, blog posts, SO answers, etc? Is everyone going to rewrite all React literature with hooks?
- pests 7y agoNo rewriting needed. Hooks are just another way to do what was already possible in a more well-defined way. All the content written is still applicable. Now there is just a new way to do things too. The developers and documentation even advises against rewriting old components with hooks unless you need to.
- pier25 7y ago> All the content written is still applicable. Technically yes, but what if someone only uses hooks and has never used classes? And, viceversa, since there is now a lot of people moving to hooks and producing React literature for hooks what if you only have used classes? So now, to be able to read all the React literature one has to understand both methodologies. > The developers and documentation even advises against rewriting old components with hooks unless you need to. It doesn't matter. A big chunk of the JS community is hype-based.
- ng12 7y agoHooks are additive.
- NewsAware 7y agoWell, 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.