Pass Props Through Multiple Levels With React's Context API

InstructorDave Ceddia

Share this video with your friends

Send Tweet

Threading props down through a bunch of components that don't care about them is not only sad, but it also tightly couples those components to their locations in the hierarchy.

React 16.3's Context API makes it possible to pass props down multiple levels invisibly, behind the scenes, and gives you new ways to organize your data.

This lesson covers how to take a React app with multi-level "prop drilling" and refactor it to use the Context API. We also cover how to create a context provider component to contain related state, and keep it abstracted away from other parts of the app.