December 2019
Intermediate to advanced
474 pages
10h 3m
English
When you want to add Context to your React application, you can do this by creating a new Context with the createContext method from React. This creates a Context object that consists of two React components, called Provider and Consumer. The Provider is where the initial (and subsequently current) value of the Context is placed, which can be accessed by components that are present within the Consumer.
This is done in the App component in src/containers/App.js, as you want the Contexts for the lists to be available in every component that is rendered by Route: