Repository navigation
Context API
So far, to share state with functional components, we've had to pass down state view props. This can get pretty cumbersome as our application grows and we try to keep state external at the app-level. Context helps solve that problem. The React docs puts it like this:
Context provides a way to pass data through the component tree without having to pass props down manually at every level.
Contexts gives us a way to share external properties directly with other components without passing down props.
Use context when something needs to be accessed by many components at different component levels. It's great for this purpose, but it can make components not very reusable.
All wiki pages are summaries of the work of others. See the top of each page for the source blogs/articles/books and their authors. All other content by Billy Bunn.