Day 10 of 14 30 minLifting stateContextProp drilling
Share state between components by lifting it up to their closest common parent. Then solve prop drilling with Context, build a theme and a signed-in user provider, and learn when Context is the right tool and when it isn't.
By the end of today you can
- Lift state up so sibling components stay in sync
- Recognise prop drilling and its costs
- Create, provide and read a context
- Combine Context with state in a provider component
- Choose between props, Context and a state library
What's inside
- 5 sections
- 3 diagrams and mind maps
- 3 code examples you can run
- 5-question quiz
- 1Lifting state up
- 2The prop drilling problem
- 3Context
- 4The provider pattern
- 5When to use what
Sign in free to read this lesson
Get the full lesson with diagrams, runnable code and the quiz. Your progress is saved across devices.
Sign in free