3 ms·
> Hooks are only 5 years old. That is a long damn time in this industry, and class-based components still work just fine.
by Eric_WVGG 1y ago
> Hooks are only 5 years old.
That is a long damn time in this industry, and class-based components still work just fine.
- throwthrow0987 1y agoI preferred class based components. The pretend functional programming style of hooks is quite imperative when you prick a little beneath the surface, so classes were probably the right abstraction.
- collingreen 1y agoThe problem with classes that hooks helped with was how hard it was to add multiple, reusable bits of lifecycle functionality. In even a medium size codebase I'd find myself having to reason about how to combine behavior A with behavior B in the onComponentWillWhatever methods. Hooks are weird but much much easier to compose and share.