Like I said in the last video, Rigolets recalled the elation it was strictly for his import on this
specific pattern in which we have Delate once you click and it is so easy to delete the specific role,
OK, for example, we want to delete Toyota.
If I click on this button here, and this is to relate to Toyota from ORAY States, OK, and then you
can come in your components here, click on components we are going to view and we we're going to view
this table and if we try to click on cars, you're going to see in cars here we are going to have states
we can't make cars.
If you try to click on make cars here and you're going to see a different data that's in this moment.
OK, as you can see, we have three cars and we're going to try to interact through this baton.
Once you click on delete.
The result is to delete this specific role.
So let us back over to your calls and we're going to continue.
What we're going to do here is you can see our delete button is working perfectly because if I tried
to make sure and click on delete, you're going to say you have clicked on the delete button.
So the thing we're going to do here is to come to us in our function.
Let us encourage.
Yes, you're going to see this is our Eliades car and our function in which you live is console like
you have clicked on the delete button.
So we are going to put our record here in order to delete this specific rule.
Let us scroll down, first of all, and the can see we are going to delete this or a specific data by
using the index, like the index of our table, our error rate, which is in our state, and therefore
this problem.
We are going to scroll down.
We are going to come here an array map function.
What's we're going to do?
We are going through eight and we're going to add a new index like this, a new parameter, which is
going to be index.
And then once you click, for example, on this specific person, like you can see we have the click
delete.
This is the props.
And once you click, for example, on this specific button and it is are used to get the index, OK,
of this specific rule, and then we are going to add a parameter here on the late kandra.
OK, here we go to the index here.
Regner say.
And here again, I say, and it's like this, I can't and if you want to.
She used these words like, hey, if you want that dysfunction wake's, you need to put Stelara function.
OK, it must have Enero function and here we are going to come in Delate Kandra.
We are going to take our index parameter like this and we're trying to say we are going to come here
already delayed Hendrika Khandala, we are going to make a copy of a rate my car's rate.
You know, let's respect the immutability condition in reactivates because we cannot --'s the states
directly.
We have to use it state.
OK, so let us come first for restoring a cult.
And here before starting for Surtees, I want to show you something.
I want to show you something.
Let us compress Shiite.
You have clicked on the delete button.
I have clicked on the delete button.
OK, let's Baton Hazing Index.
And sluttiest, you know, the truth detects what's we have a lack index.
Come on in this console like.
You can see you have clicked on the delete button, having index zero click here, and so we are going
to detect this index and then you can delete this specific role.
Readers comment is and the first thing to do is to make a copy, because you cannot do like this.
You cannot say, OK, you cannot say Meeteetse direct to your state.
OK, we that's using the state states and they let us come first for creates a course.
We're going to say, nuh uh.
We're going to say new car, OK, new cars because we got the latest word and what we're going to say
here, uh, use this rate.
Is this the state that make.
OK, and then we are going to make a copy and after that we are going to take new cars like this.
And we are going to say new cars, we're going to put comma a lot, we're going to call this place function
and the first parameter is going to be our index.
And the second way is going to be the number of road that you want related issues.
As you can see, we are going to dilates one.
OK, so you're going to leave like this.
And after nights, as you can see, we have mutated our new cars, which is a copy from all right,
make cars and then we can use the state seats, OK, in order to update our my cars, which is in our
states.
And then you can easily do like these.
Uh, this, this that said states like this.
OK, and so what's regular to.
Here you're going to we're going to see my cousins is going to be escorted through new cars like this,
OK, because you can say by using this, they said that function, you can say, why not true.
And to take directly away those states, my counsel, and then.
Put it inside here in order to make a copy, if we Triphase for to say new car, new cars, if we tried
to say, for example, this is the safest.
What is this that states make cars?
OK, if you want to respect the immutability condition.
Make sure to use the state function.
OK, you cannot mutate your state out of this function.
OK, you cannot say you touch your your your state out of dysfunction.
You can make a copy and make the end and make you update instead of the states.
Let us confuse all these dots.
That's it.
And if it's right, for example, to say dot, splice, slash your index, OK?
And sure enough.