4 ms·
Departure from class based components was one of the motivations behind hooks, those are: 1. It’s hard to reuse stateful logic between components 2. Complex c
by codeptualize 4y ago
Departure from class based components was one of the motivations behind hooks, those are:
1. It’s hard to reuse stateful logic between components
2. Complex components become hard to understand
3. Classes confuse both people and machines
See https://legacy.reactjs.org/docs/hooks-intro.html#motivation https://legacy.reactjs.org/docs/hooks-intro.html#motivation for details. Agree or not, but it is a very intentional and well motivated direction.
- theteapot 4y agoAbove was OO an based solution to #1, and arguably #2. Many would argue hooks did nothing to solve #2 and may have made things worse. > Agree or not, but it is a very intentional and well motivated direction. Agree with problem exists (roughly), disagree on solution.