4 ms·
Regardless of how you feel about hooks, they are, or are quickly becoming, the new standard for most React code, so a React tutorial obviously needs to familiar
by realharo 6y ago
Regardless of how you feel about hooks, they are, or are quickly becoming, the new standard for most React code, so a React tutorial obviously needs to familiarize people with them. The current tutorial is good at explaining React concepts though, so making the jump to hooks after reading it and doing a few simple playground projects should be trivial.
As for why people like them so much as opposed to classes, my guess would be that they let people more easily write reusable behaviors for common tasks (e.g. look at this one for integrating with RxJS Observables for projects using RxJS https://github.com/LeetCode-OpenSource/rxjs-hooks#examples https://github.com/LeetCode-OpenSource/rxjs-hooks#examples - with classes you would have to put code in several lifecycle methods, sometimes duplicate code, for each individual component).