<Login />
and <Auth />
Review, Research, and Discussion
- Why is the Context API useful?
- it enables the user to exchange unique details and assits in solving propdrilling from all levels or the applied application.
- Can a component outside of a provider get its context?
- yes through importing the useContext() hook
- What are some common use cases for using the Context API?
- context is helpful in creating the layout of an application and affecting the color applied to the applicaiton.
- Describe “Context Hell”
- the React Context hell is the nasty code you get taking advantage of the React Context API.
Vocab
- global state - data that is share throughout the entire application.
- global context - sharing state throughout the application without passing props.
- provider - parent component sending Context for its child component to consume.
- consumer - child component that takes in and uses the state/data that its parent’s sends down.