4 ms·
From the looks of things the main benefit is less boilerplate? What are the other benefits from beyond this?
by meheleventyone 3y ago
From the looks of things the main benefit is less boilerplate? What are the other benefits from beyond this?
- codeptualize 3y agoMainly 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.