Go ProSign in

This Lesson is for Members

Subscribe today and get access to all lessons! Plus direct HD download for offline use, enhances transcripts, member comment forums, and iTunes "podcast" RSS feed. Level up your skills now!

Unlock This Lesson

Already subscribed? Sign In


    Pass Props Through Multiple Levels With React's Context API

    Dave CeddiaDave Ceddia

    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.

    You must be a Member to view code