Why Hooks? / Why not Classes?

Class components are verbose and cumbersome. In many cases, we are forced to duplicate our logic in different lifecycle methods to implement an ‘effect logic’.
Class components do not offer an elegant solution to sharing logic between components (HOC and friends are not an elegant solution) — React Hooks, on the other hand, give us the ability to build custom hooks, a much simpler solution.

#react-native #javascript #front-end-development #reactjs #react

Replacing React Lifecycle Methods with Hooks: A Comprehensive Guide
1.25 GEEK