Imagine this is an actual website, where components need to display some state, or let's be crazy: even set some state !
Hey! what's up!? I'm the Header of this website. Look at my pretty state:
counter1 | 0 |
---|
counter2 | 0 |
---|
ui | |
---|
chuckNorris | |
---|
We, buttons below, live on the ground floor, level 0, in the App.js file directly but, we're cool!
👀 👍Hey, dude, Footer here. Don't mean to brag, but my children too have access to the state, and I'm not even passing any props to them!
I have access to everything: I'm the king of the world! Look at all that state :
counter1 | 0 |
---|
counter2 | 0 |
---|
ui | |
---|
chuckNorris | |
---|
Some Nested Component - but no Prop drilling is allowed here👅