useReducer and Complex State
Move tangled state transitions into one reducer function, design clear actions, and know when a reducer beats several useState calls or a state library.
- Level
- Intermediate
- Chapters
- 4
- Exercises
- 1
- Reading time
- 16 min
What you will cover
- 1. Why a ReducerThe point at which several useState calls stop being the simplest option.
- 2. Writing a ReducerPurity, action design, and the signature in detail.
- 3. A Worked ExampleA complete todo reducer, from actions to component.
- 4. Beyond a ReducerWhen local state is no longer enough, and what the libraries actually give you.
Up next after this one: Custom Hooks