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

    When to useState instead of useReducer

    reactReact

    useReducer is definitely more powerful than useState (you can even implement useState using useReducer), but there's one scenario where useState is almost certainly better than useReducer:

    When it's just an independent element of state you're managing: useState

    This is based on my blog post: Should I useState or useReducer?

    And don't miss When to useReducer instead of useState