Class Twenty-Nine Notes (401)
Advanced State with Reducers
- Reducer can be useful to manage multiple states, actions involved includes setting an action type and dispatching the action when appropriote. By doing so, multiple states can be updated at once, rather than being managed individually.
useReduce
is named as reduce because it’s like having an array accumulate. A reducer should be used when multiple states should be updated all at once.
Back to main page
References