1 00:00:00,360 --> 00:00:05,460 In the cost component we have lifecycle cycle members to every former astronaut in this specific life 2 00:00:05,460 --> 00:00:13,010 cycle stage of our component to use if the host allow us to perform side effect in our functional component. 3 00:00:13,110 --> 00:00:16,200 So first we have to import the youth the Fed from we add 4 00:00:20,540 --> 00:00:32,130 and then inside the EP we can add a youth if at every candidate or this sentence and then we just create 5 00:00:32,130 --> 00:00:38,030 a function alert FDA as you see fit. 6 00:00:38,100 --> 00:00:46,380 So let's have a look and you can see the GM use if Red Alert allergies here and no matter how we type 7 00:00:47,250 --> 00:00:51,550 or delete the card or even we talk with a card. 8 00:00:51,990 --> 00:00:56,800 It also showed the alert year. 9 00:00:57,090 --> 00:01:03,880 So what can we do if you just want to alert ones only when the website is opened. 10 00:01:03,990 --> 00:01:13,330 We just need to add a square bracket here and now you can see these have to alert but when we do take 11 00:01:13,330 --> 00:01:18,200 a card or even we toggle does show showed high court it will not show the alert. 12 00:01:19,920 --> 00:01:25,120 So this is how we can perform the equivalent of component B mount using the use effect. 13 00:01:25,120 --> 00:01:25,660 Whoops. 14 00:01:25,750 --> 00:01:33,460 But how about if we just want to watch the card changes this time we are passing one way of dependency 15 00:01:33,460 --> 00:01:40,600 errors the second perimeter and inside our way we should pass the dependency that we want to what for 16 00:01:40,600 --> 00:01:44,560 example we just add that we want to wash the card. 17 00:01:44,980 --> 00:01:47,130 So we have to add the cots here. 18 00:01:47,590 --> 00:01:52,060 But you see there is some warning because the console was used to before it was defined. 19 00:01:52,100 --> 00:01:58,820 So we have to move these brought of course under the cards. 20 00:01:58,910 --> 00:02:01,870 So now you can see the alert. 21 00:02:02,390 --> 00:02:02,770 Yeah. 22 00:02:02,800 --> 00:02:09,760 At once if it will not to alert maybe toggle so hide button. 23 00:02:09,760 --> 00:02:17,500 But if we met some changes on the cards such as add some words and change the name it will show the 24 00:02:17,500 --> 00:02:27,820 alert because the day some changes on the cards or if we did the cause it also alert because it already 25 00:02:27,850 --> 00:02:28,460 did it. 26 00:02:28,600 --> 00:02:31,420 One of the data here and make some changes or to cut. 27 00:02:31,960 --> 00:02:35,590 So it will also alert the FTSE use if at.