Skip to the content.
Home Page
Class 32 Notes
Review, Research, and Discussion
- When you have multiple contexts it doesnt matter what kind of component you make. They can still be used in the same way. My personal preference would be to make it a functional component like any of the other React components I make.
- Some good use cases for global state are setting default values in an application. For instance when you want to toggle something or prevent an action.
- To test context you can use state and try to modify its setting.
Terms
- Context: It is a specific set of instructions or state for your application to follow. It can be thought as global state.
- useContext(): This is the function that allows you to use the context hooks in your components.
- Static Context: This is a context that is set and cannot be modified. It is the default.