1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    Declaratively Interact with Complex Component State using the React useReducer Hook

    reactReact

    Having to use useState for every item in your state quickly gets cumbersome. In this lesson, we’ll learn how to refactor our component to use useReducer instead.

    We'll cover:

    • Creating an initial state with useReducer
    • Making a reducer function that makes changes to the state based on incoming dispatches