And we're going to trade today is the first part of our lesson about the Kurds, how to remove a product
from Todd's voice and let us make sure our records are records ease.
Just hear our enemies and we are going to create a new function that that's Reglan to remove the call
from cards removed from cards.
This is our difference.
Perhaps we have image, the pros and cons, our different props, and we are going to create a new purpose
that's going name, remove that Facebook, create the new function just after it's called Hindry function.
We're going to say and we're going to say remove that this remove from cards handler.
Easy to do this.
OK, what's regnant soon and it will be anything we can to say they call like this or is it something
is important here?
They call no, we don't need it.
It's really an error function that is OK and what's required.
Let us make it clear the like.
And here we're going to use our story template litterers and we're going to say you want to remove like
ports like this.
You Dorasan, they call, they want to remove, they call nodes brains.
That is, you want to remove the cartloads brains.
This is a cancer like and it does take or just cause, which is a here Grayden.
And that is a very good.
Sharett, take that remove from car Tendler, I'm going to copy dysfunction and I'm going to create
a props, a props that I'm going to name remove from cart.
We have AIDS.
Where are we going to put these props.
We're going to put it in our Ricard's components, OK, because the spots on here in which recalculates
is Endicott's elements.
Endecott components.
It does come here.
We're going to say remove from cuts.
I'm gonna remove this handler.
You can put this same thing.
He no problem that this is these dots are removed from Cassandre.
OK, so let us take this perhaps copy, and so we're going to test to see the interaction that's required
here between the cross about Centier, the remove button is red button and a great function which is
removed from concentrate.
We are going to test the interactivity.
So let us come in.
Our cockroaches come here and we have our button in which we have discoursing.
We are going to directly put our props by saying, for example, creating a props that's going to remove
from cards.
And here we are going to call our props by saying props, darts, remove some cards.
And here, do not forget, you need to put your parameter because you must have the specific elements.
OK, so what's required to the first thing is to make your AURIN let us come here first are the address
in which we have here these thoughts and directly here.
We can take these properties like these objects in order to get all properties of color.
And do not forget, declare your inner function like this is very good.
We have it here and here.
We are going to put our parameter in which they call like this in order to get all properties.
And here we are going to call this and we're going to call these props in a rate cut to the chase.
Yes.
So remove this props, remove from cuts the records.
And we are going to take these props and we are going to bring these props in the red component, which
is the chase.
And you can see we we are going to use the unclick.
And here we have already put it to cards, OK, because we are using the only the only one component,
which is Butson.
So how to solve this problem or you need to remove it cards and replace remove from cards and then the
cut cut on will not work again.
So in order to avoid this problem, to make this dynamic so make sure also to create a standard props
about the unclick button.
So let us make Facebook what I want to say.
Instead of saying intercuts, I'm going to say click, OK, it will be a standard and I'm going to copy
and I'm going to come also in my card, which is instead of to create a props we've removed from cards,
which calls the remove from parts props, I'm going to say click, OK.
And here I'm going to take this same and a props and bring these props in our bottom doges components
here.
I'm going to say props dot click.
And once you you are, for example, in this part, it will understand that this click means add to
cart.
But if it if it comes from yes, it will understand that these cliques mean remove from cards.
OK, so you need to put this when you call your components Budson.
OK, in the other side here in Hamdard Chess you don't have to put cleek, you can put if you want,
but it is not necessary.
But you need to put a standard called a standard props where we call the real component.
When you call your components, which is for example, in this case Bouchon, in which we're going to
click and react, and in this case we are going to solve this problem.
And let us Big Brother, let us click on inspect, click on console.
And here you're going to click on Nisan like this and no, not intercuts.
Please not educate, but every move I have clicked on click on Remove.
You want to remove Toyota.
OK, we have Mercedez I think.
Click on it.
You want to remove Nissan.
OK, where's Mercedez.
This is Mercedez.
Click on Mercedez.
Click here.
You want to remove Mercilus.
OK, and we see that we have interaction between already bots on our remove button and our remove from
cart function.
So let us come in our a Honda chest.
So the thing we're going to do is to uh to delete, OK, to remove the records.
So I think that, you know, I can't even Giorgis and I'm going to come here and run and say I'm going
to create a new constants in order to.
With respect to immutability a condition.
OK, because I can't relate directly, I can say I can't suppress, I can't say remove directly from
my state these elements, OK, I need to make a copy and I'm going to mutate this copy to remove any
copy.
And Aden's I'm going to update's I'm going to take the third of this copy and assign this value in eight
times, which is in our state and inside of the state state function in order to be updated.
And I'm going to say carte items and I'm going to say and here I'm going to use this rate that is OK.
And I'm gonna say these thoughts state dot items actis using the props, they separate, please.
And I'm going to copy all in car items.
So what I'm going to do and there this is different and this is the thing.
And let us come up here.
The first thing we're going to we're going to select is the index of the elements that we want to remove.
So I'm going to declare a new contest.
I'm going on an index and here I'm going to say these dots state.
That's items the map and no map, but we are going to use the influence index, yes funds index in which
we're going to have any function, that is his index.
And here we are going to say in this.
OK.
That it is they call the shots.
I think it's written this or etat, that is.
OK, the index is a science value, but neither you can tell is a sign there, but there you use it.
Yes, and we are going to take this index here.
We're going to copy these costings.
So the thing we're going to do is to record items and we're going to say splice lattes.
And inside of our splice, the first thing we're gonna put is to put the index into the number of elements
that we want to show remorse.
And I feel that we are going to access in our results the set a state function in which we're going
to put the items here.
We're going to update our state's.
OK, very good.
So let us back here, click on this is the first song, any song, salsa, and if I click here, three
chords.
Click here.
There, very good.
Here.
Very good.
It works perfectly OK, and I think that we get finished with these parts and in the next video, we're
going to see how we can display a kick or hide this from like display or hide this from.