0
Challenge · 21React Core
Sharing State
Coreused in ~90% of apps
Lifting state works — until you're threading the same prop through five layers. That pain has a name, and a cure.
Core idea. When many components across the tree need the same value, prop-drilling gets painful — which motivates Context and global stores (later tiers).
poke it, drag it,
try to break it
try to break it
no slides here.
you drive.
you drive.
Playground, this isn't a screenshot
<App />
owns the data
user="Aria"
<Page />
doesn't use it
<Sidebar />
doesn't use it
<Profile />needs the value…
?
waiting for user…
App owns the value. Press play and watch how it reaches Profile.
forced to forward (drilling) reads directly (context)
↑ play a little first, then dig in