useReducer

Learn how to use the useReducer Hook in functional components.

We'll cover the following...

The useReducer Hook is used for global state management. It is used to separate the state management logic from the rendering logic, i.e., the state should be managed at a separate place, and the logic for the component should be written at a separate place. This is because managing the state and writing the logic for the component in one place clutters the codebase and makes it unreadable and unmaintainable. This is the case with the useState Hook, which is good for managing simple states but becomes difficult to use and maintain for complex states. Hence, the useReducer ...

Access this course and 1400+ top-rated courses and projects.