4 ms·
Mainly hooks. Hooks make it easy to reuse component logic, something that was difficult with class components. You’d need HOC’s which are hard to deal with, esp
by codeptualize 3y ago
Mainly hooks. Hooks make it easy to reuse component logic, something that was difficult with class components. You’d need HOC’s which are hard to deal with, especially with prop collisions and refs.
(This change has little to do with OOP vs functional. React calls them function components, not functional. React has always used functional patterns, even in the class components.)
- meheleventyone 3y agoThanks I went and looked up the different approaches (have never written a line of React in my life) and I definitely like the hooks more on first blush.