What is React context and when should you use it instead of prop drilling?
Updated Apr 23, 2026
Short answer
Context provides a way to pass data through the tree without threading props through every level. Use it for broadly needed, moderately stable values like theme, auth session, or locale—not as a replacement for all state management or for high-frequency updates without care.
Deep explanation
Context updates re-render all consuming components unless split into multiple contexts or combined with selectors/memoization patterns. Prop drilling is fine for shallow, localized data.
Unlock with a Pro subscription to view this section.
View pricingReal-world example
No real-world example available yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProCommon mistakes
No common mistakes listed yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProFollow-up questions
No follow-up questions available yet.
Unlock with a Pro subscription to view this section.
Upgrade to Pro