Andrew's Digital Garden

The State Reducer Pattern using React hooks

#todo

  1. End user does an action
  2. Dev calls dispatch
  3. Hook determines the necessary changes
  4. Hook calls dev's code for further changes 👈 this is the inversion of control part
  5. Hook makes the state changes

https://kentcdodds.com/blog/the-state-reducer-pattern-with-react-hooks

[[20210705094040-inversion-of-control]]

[[designpatterns]] [[react]] [[reactapi]] [[reacthooks]]

The State Reducer Pattern using React hooks