WeCodeAcademy

Context

Context passes data deep into the tree without handing it through every level as props. Create it, provide a value above, and read it with useContext below.

Examplereact
Open in editor »

Toolbar never receives the theme as a prop, yet Label deep inside can read it.

Quick check

What problem does context solve?

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.