2 ms·
I couldn’t disagree more. Having components be pure functions makes testing and developing so much easier, not to mention the reusability of hooks. Class compon
by maronato 3y ago
I couldn’t disagree more. Having components be pure functions makes testing and developing so much easier, not to mention the reusability of hooks. Class components were a mess. They had way too much business logic and state stuffed into them that it was impossible to maintain any reasonably large component.
Of course you can still write shitty code with functional components and hooks, but at least now the paradigm itself steers you towards more maintainable code
- nitwit005 3y agoHaving uses both, it just feels like trading one set of quirks for another set of quirks. In general, hooks seem tidier, but the quirks of useEffect seem rather more surprising than the old way.