We can easily at stay to the bottoms components.
But until now the only way to pass data to a component is to bring was to move a stage to a higher component
and then pass it back to the Springs.
We are props.
Now we will create an app that the FTA as include a component eight and a component a will include a
component B and a component B will also include a component c.
In this case we need to pass the state from the top levels of the application through all the intermediary
to the Component c given to the component a and component B do not need this data.
This is tedious and time consuming and also long as props during contact for Y is a way to pass data
through the component trees without having to pass the props down manually at every level.
This is a brand new app without any fancy and just have a brand.
This.
And now we are going to create a few components.
So now we are going to make a photo's called components and First we create a component a thought the
S and we type our FC
and then we create a component B
and we also create a component C
type component aid add component 8 and then we go to a component B and type component B and also add
a C we do the same things
and now inside the component a we are going to import the component B
and then we go to the component B we will import a component C
now we back to the AB J S and we are going to try to pass a where the O from the app J asked to the
component C directly by using context.
We go to the app J S and then we are going to export cornerstone name contest is equal to we at all
a contest.
Now we are going to wrap the whole app by using the name contrast thought for wider but first we are
going to import the component a
a component B.
We forgot to import a component C
Now you can shoot a all the components on the website.
Now we are back to the EPC ash and we are going to use the contest.
So we need to wrap the whole app using the ram contest stop provider.
For example we passed a where Leo Smith
and then we go to the component C and then we we import the contest
and then we are going to consume the contest.
Oh we have to use the name contest our consumer
now is everything right.
The names move should be appear at a component C so let's take a look at the component C contenders.
Where are they.
Here.