In the cost component we have lifecycle cycle members to every former astronaut in this specific life
cycle stage of our component to use if the host allow us to perform side effect in our functional component.
So first we have to import the youth the Fed from we add
and then inside the EP we can add a youth if at every candidate or this sentence and then we just create
a function alert FDA as you see fit.
So let's have a look and you can see the GM use if Red Alert allergies here and no matter how we type
or delete the card or even we talk with a card.
It also showed the alert year.
So what can we do if you just want to alert ones only when the website is opened.
We just need to add a square bracket here and now you can see these have to alert but when we do take
a card or even we toggle does show showed high court it will not show the alert.
So this is how we can perform the equivalent of component B mount using the use effect.
Whoops.
But how about if we just want to watch the card changes this time we are passing one way of dependency
errors the second perimeter and inside our way we should pass the dependency that we want to what for
example we just add that we want to wash the card.
So we have to add the cots here.
But you see there is some warning because the console was used to before it was defined.
So we have to move these brought of course under the cards.
So now you can see the alert.
Yeah.
At once if it will not to alert maybe toggle so hide button.
But if we met some changes on the cards such as add some words and change the name it will show the
alert because the day some changes on the cards or if we did the cause it also alert because it already
did it.
One of the data here and make some changes or to cut.
So it will also alert the FTSE use if at.