Join egghead, unlock knowledge.

Want more egghead?

This lesson is for members. Join us? Get access to all 3,000+ tutorials + a community with expert developers around the world.

Unlock This Lesson
1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    Pass Data through a Component Tree using Context Providers and Consumers in React 16.3

    reactReact
    ^16.0.0

    With React 16.3 a new Context API was introduced. It provides a way to share values like that are considered global between components without having to explicitly pass a prop through every level of the tree.

    When creating a context we get a Provider to pass values into the tree, as well as Consumer in order get them out.