And yes, as you can see, if I change, if I click on the second edit, I'm going to get E in the second
row if I click here.
Very good.
Yes.
And let us begin viewers to your codes.
So what's required to here is once we click on this button, the desire is to head to call a function.
We're going to create a function here.
We're going to call this function update validation called function updates validation handler actis.
And it will be in error function.
Latest upped validation, and here we are going to create a process, as you can see, we have a components
and if we come back to do this, which is the really elements, we have a click process here.
So we are going to take these props, come in our form to edit.
We are going to say click splays, we're going to put click is going to be called to this.
We're going to call this function.
Uh, what's his.
What is the name of the function opted for additions like update validation, Hendra and the rechange
display frizzle a consolo here to see if it's Wake's you have.
Clicked on.
The athletes, but artists who have clicked on the updates about talent let us make here click on console,
click on updates.
Nothing happens while it is click here.
Updates is canceled.
Yes.
As you can see, it reloads.
There it goes.
If you click on edit, I bet you have clicked on the updates button.
As you can see here have it's Wick's.
So the thing we want to hear we're going to remove is for this consoles and we are going to our cost
autists and we are going to make our modification, our updates in our updates.
Catanzaro update, Endler update car Enzler.
And here we are.
What we're going to say, this is our form to edit and sort of or from to edit, as you can see.
And we are going to
update.
Yes, we are going to make it props, OK?
We are going to create a props in our form to edit in order to pass this function updates.
Corrine's right from the constants, which is the power components to reform, to edit.
We are going to pass this function and here once we click on updates, we are going to call this function
inside of this function.
We are going to, uh, take these functions at the props.
It is very simple.
So let us make the first thing we're going to do here is to, uh, the first thing we're going to do
here is to update the to make changes of array states of our specific state.
That's reason to to edit here.
So let us in our visual codes.
And if we want to update, we will need four parameters.
DeFries parameter is going to be ID.
Let us come here, we're going to have this for ID and the second is going to be Brint.
The third is going to be Carlaw.
The fourth is going to be Pricelock.
This we have four parameters.
And as you can see, let us come here.
And the first thing we're going to do is to.
The first thing we're gonna do is to find is to find a first for the index of the specific role that
we have that we want to update by using the idea, the specific, is it OK if I know, for example,
the idea of this first, I can take this idea and take this into tech.
It's an index, for example, with Toyota, the index is equal to zero and say, I'm going to take this
index by using its idea.
And what I'm going to do, it is very important to say CONSED Index is going to be equal to this DOT
state.
We have already seen all these states wearing a say in my cars.
Very good.
And we're going to say finds index like this.
And here we're going to have Enero function in a real function and we are going to say Ireton index
that ID.
Index does it and is going to be equal to this Heidi.
OK, very good.
This idea that I can't.
And then we are going to return to index of deciding, for example, a free first hand, if we want
to update, for example, Toyota, we are going to get this idea, which is one.
And by using the funds index function, we are going to return the index of this first list here and
we're going to get zero.
OK, yes, it is very simple, very simple.
And we are here.
And after gearing our index, we are going to continue.
We are going to create a new update list which will be composed for all these parameters.
We're going to say new car.
We can say.
Yes, new car.
And a new car is going to be called true.
We're going to have a list, as you can see, Latisse and DeFries is going to be OK Idy, which is here
in ORATE states in our area, and it is going to be equal to this idea like this.
We're going to say you're going to be equal to Idy.
As you can see, the ID can't change, but we're going to have to.
And it's only through the brains we have used.
We have used the idea only to return the index of the specific rule in order to update us in this index.
You're going to see the importance of this index.
Brent is going to be equal also to this.
And once I click on Brent, you're going to see I'm going to have a a what's Behrendt's here?
Let us click here.
I can see we have it like this and free color also the same thing.
Color color is going to be equal to color.
And price is going to be equal to price, and as you can see, if your state is equal to your different
parameters, if you have the same thing here from left here to the right, you have the same thing.
Instead of putting all like this, you can't remove.
You can't you can't remove it.
And you're going to leave only one data.
OK, so that means, A, the two sides is identical.
That is.
And you're going to put only come like this.
OK, as you can see, you can leave it like this and make sure to keep.
So keep this in your mind.
You can find some cards like this.
Yes.
Very good.
Lettuce.
OK.
New car, this is a new list and what you're going to see, we're going to make a copy of in order to
respect the immutability condition because we cannot mutate directly or we make cars, which is in our
state.
What are we going to say?
We are going to say const.
New cars in plural, like these new cars, we are going to use freight and so we cannot copy these 30
states that make cars and then we are going to mutate this copy.
And after mutating this copy, we are going to assign this copy to the real estate, which they really
did.
So it is my cars in our states in order to respect the immutability condition.
And after it, after copy, after copying, we are going to take new cars and we are going to mutate
this copy.
OK, do not mutate this.
That directly makes us a copy.
And we are going to mutate this copy in order to respect the immutability condition.
So we are going to say you are going to mutate where the index is.
This index.
OK, yes.
I think that you understand the importance of this index here.
And in this you are going to say it's going to be equal to a new car.
And so we are going to also write the last village, which was and is in the last states, the last
data.
And after that, we are going to use this that we we're going to call the states that function and take
this update, take these changes, use the states that function, because you cannot move to the state
directly next.
Sure.
Always to use the states that function.
And here we are going to say.
My class, my class is going to be called to new cars, plural, like this, and then your turn, this
is going to be done.
Very good.
And the words there as big.
Let us click on edit click on average, nothing happened, let conference or nothing will happen because
we didn't yet call these updates Endsleigh.
We didn't get past this update Henslow function as a props from its edits because the update button
is here, so we need to pass this from these updates.
Currently flat function, lucky props from the parents components to the aid components.
That means once we click on updates, we are going to call the updates validation hinderer, which is
dysfunction here.
And instead here we are going to call this function as a props.
OK, so make sure to pass this all this up.
It's called Hensler like it props in our edits, our reform to edit.
So we are going to come here.
I'm going to say updates.
CAR is going to be a props and it is going to be equal to this.
It will be a function that's.