So let us make sure in our course in this lesson, we are going to record the second phase, which is
the updating phase, OK, in religious components like in religious components and in religious components,
love seekers.
Get so I'm going to advise you to to comment.
This is parts.
So we are going to leave only the components.
OK, let us back here in our ARANETA function.
OK, we are going to commence the timer components.
Let us be clear, can't rely on this page and what's it going to say?
We cannot record the updating fees.
As you can see, I have told you and when we are now in the component demands, OK, what's the components
is mounted.
We cannot access to the second phase, which is the updating phase.
And in this uplifting phase, we can update our creative components, like by updating our creative
components, we are going to court the state that function.
Like they said, that function allows us to create components to update components that we have already
created in the mountain phase.
And once you create most recently excuse me, once you update your components, we are going to access
the game to the render function because the render functions will now help us to render this update
to the dome.
OK, render this update to the dome in order to view these different tenses, because you can say,
for example, for the first time, as you can see for this first phase, our step is equal to one.
That means the mountain phase.
But once we access in the components this month, once our components is mounted, we are going to pass
from the step.
Want to step two, which is the updating phase?
OK, so the state function will happen inside of the components this month.
OK, make sure to call your state function in your component this month because when you are inside
of your components these month, that means the component is mounted and now you can't use the set set
function.
OK, so let us right now to update our step away step data, which is inside of our state from one to
two, because we are now in our updating phase, which is the second phase, and we're going to see
how our readjust will automatically call the render function in order to render this update to the dome
in order to view these changes.
OK, and when our component is updated now, we can access to the components update.
It is very simple.
So let us back our visual studio code.
So what was written to say we are going to come in every component this month and we are going to update
this step because here the component is mounted.
So we want to pass to the second phase, which is the updating phase.
Let us come here.
We're going to see this do not do not do like this.
For example, if you want to update, you're going to say no, I can say this dot state, dot step,
OK, you're going to say plus plus like, OK, that's me.
OK, you just say plus plus okay.
You add one or equal to these states plus one.
OK, Latisse.
So do not do like this.
OK, it is not recommended.
It is not very well because you are in, you are out of room, you are out of your construction if you
are outside of your construction.
Use state it if you want to update a data that you have in your state.
OK, if you're out of your construction, you have to use the state state function in order to update
these states.
OK, so let us scroll down here.
We are going to say this dot state state, OK, it's states like this.
OK, call this function, and instead of our function, we're going to put cloudberries is here and
we're going to say you're going you're going to take this step.
OK.
Put it here so you are not going to stay here, OK?
You're going to take this step.
Which is the value, which is the variable.
OK, this tape, which is the variable in which we assign this village.
OK, we are going to say, step, you are going to be equal to the current value, which is one plus
one, because we want to pass from step one to step two.
OK, so what you're you going to say take the current value now?
You're going to say this dot state that OK, dot step in order to take the current value, which is
one.
And now you're going to add one and the step is going to be equal to two once you call this sets state
function.
OK, once you call the state this function.
That means you update your status and directly it will automatically call again the render function
and a render function will render this update to the dome in order to display these tenses.
And now we can access to the component update.
So let us back in our viewers to the code.
As you can see, I have just told you a once this update, OK, is done, it will automatically call
a get the render function.
And that means here we are going to have another council log in which we're going to have stepped through.
The created component is the render function.
So let us begin our brother to see this updated this update.
OK, as you can see, the component is mounted.
And instead of this function, we have updated our status and directly, it's called a render function.
And here we have dismasted that creates the components is in the render function, OK?
And we pass in they created in the return function because the render function will render this update
to the dome in order to be displayed again in our browser without reloading the page.
And here, here the created components is displayed.
So letters displayed.
Ladies, please.
Yes, like this, and there it will be displayed again because for the first time we we we had another
value and once we did OK, it must automatically reload our browser.
OK, so it's automatic reload.
That is where the Newville is.
You can see we have stepped through the creative component is there in there and the created component
is displayed.
Very good start.
Let us back in a visual studio calls his can see here.
They don't need the update here.
And you can see the state state function allows us to update your status, which is your class.
OK.
So after that's what we're going to do now.
We are going to call the components did update.
OK, because I have told you once your data, your state is updated, we cannot access to the components
it updates.
OK, so let us be OK.
We are going to say see Dupee, that this component needs updates and components.
Updates has two parameters.
The first parameter is the Peugeot's Proops and the second is the pujas states.
OK, if you try to make a console log of Cliff Proops like this.
They does.
Make also for the Peugeot's states.