...

/

The Need for Hooks in React

The Need for Hooks in React

This lesson will examine the motivations behind using React Hooks in your code. In addition, the biggest benefits of using React Hooks today will also be discussed.

Motivations can be defined as problems React Hooks solve and the benefits gained from using them instead of writing classes.

Continue with the lesson to see the main benefits from using React Hooks.

Better code composition

If the diagrams in the previous lesson are compared, it shows that React Hooks allow you to write code in a more functional way.

When using classes, the side effects logic in different lifecycle events are being divided. This makes it harder to follow code composition and the flow of data. Hooks solve this ...