reading-notes

Class Thirty-Two Notes (401)

TitleContext API - Behaviors

Scaling up with reducer and context1

The useReducer and useContext can work together by first setting a reducer, and use that in a context so it can be dispached to any children in the app. This can be helpful for not cluttering up a file and keey the code clean, and the dispatch only needs to be defined once.

This can be further decluttered by moving all wired components into a single file, which can be accessed by other components when needed

Back to main page

References

  1. https://react.dev/learn/scaling-up-with-reducer-and-contextÂ