Skip to content

Latest commit

 

History

History
24 lines (20 loc) · 989 Bytes

File metadata and controls

24 lines (20 loc) · 989 Bytes

<Login/> and <Auth>

Review, Research, and Discussion

  1. Why is the Context API useful?
    • it allows you to pass down state without having to pass props through each component layer
  2. Can a component outside of a provider get its context?
    • No, context can only be accessed by child components of the provider
  3. What are some common use cases for using the Context API?
    • If you need to make a UI theme available throughout a website
  4. Describe “Context Hell”
    • When you have multiple types of Context being used by the same components
    • This can result in multiple layers of wrapping around child components in the provider context

Vocabulary Terms

  • global state
    • state that is accessible to all components
  • global context
    • basically global state, available to all child components of the provider component
  • provider
    • the component that provides Context by wrapping sub components
  • consumer
    • a sub-component that utilizes Context