Module 4 · State that scales Lesson 11 of 15
Context: sharing state without prop drilling
Context lets a value be read by components far below without passing it down through every level. It is for the few things that are genuinely global: the signed-in user, the theme, the language.
Worked example
Wrap the app in a provider, then any component calls useContext(ThemeContext) and reads the current theme, however deep it sits.
Your practice task
Lift the current user into a Context and read it in a component three levels down without passing a prop.
Do this before moving on. Reading a solution teaches the shape of it; typing it teaches you.
Key takeaway
Context lets a value be read by components far below without passing it down through every level. It is for the few things that are genuinely global: the signed-in user, the theme, the language.
Keep your place in this course
A free account saves which lessons you have finished and unlocks the certificate. The lesson itself stays free to read.
Create free account or sign inCourse complete
You finished every lesson.
Your certificate is ready, and the projects you built are the proof to attach to an application.
Almost there
15 lessons left of 15
Finish every lesson to unlock the certificate. Each one ends in a practice task — do them and the final project brief writes itself.
