1 00:00:00,270 --> 00:00:06,840 In we at the computer will we render even the changing of state is not related to them. 2 00:00:06,990 --> 00:00:12,530 To demonstrate this we can create a button component and a stage for us. 3 00:00:12,750 --> 00:00:18,990 We are going to enforce the state farm we ate. 4 00:00:19,020 --> 00:00:24,140 Then we can go to create a state count a and set time. 5 00:00:24,170 --> 00:00:31,320 8 We will also create can be and set can be later so we name it as a first. 6 00:00:31,320 --> 00:00:40,020 Then we go to create a increment functions which is using to increase the awareness of can a and inside 7 00:00:40,020 --> 00:00:40,990 the grant up on the site. 8 00:00:41,000 --> 00:00:43,950 And we are going to display the value of a. 9 00:00:43,980 --> 00:00:51,600 So we are going to type it empty as young age and also this trade a conk a rarely loose and then we 10 00:00:51,600 --> 00:00:58,590 are going to add a button so you can trigger to increment a functions to increase the value of count 11 00:00:58,650 --> 00:00:59,230 a. 12 00:00:59,250 --> 00:01:04,500 So after we create the buttons we are going to create a component. 13 00:01:04,620 --> 00:01:12,960 So we added photos called components and we added components a G S 14 00:01:17,650 --> 00:01:21,730 in order to count the number of times that it renders. 15 00:01:21,790 --> 00:01:33,390 We are going to import that use e fat and we let the red dot com initial radio is zeros and anxiety 16 00:01:33,630 --> 00:01:36,130 can put on a we used to use fat. 17 00:01:36,430 --> 00:01:43,300 We will not add the square brackets so it will render every time it the component a was triggered and 18 00:01:43,300 --> 00:01:50,830 every time it was triggered or rendered we are going to add the radio of the render account and inside 19 00:01:50,830 --> 00:01:56,440 the render function we are going to display the number of when the times 20 00:02:01,520 --> 00:02:05,200 and then we back to the J as and then we import the component eight 21 00:02:07,970 --> 00:02:09,110 from the component a 22 00:02:13,660 --> 00:02:18,390 and then under the paragraph we import the component eight. 23 00:02:18,400 --> 00:02:26,530 Now if we try on cooking to increment A you will see although the component a do not receive anywhere 24 00:02:26,530 --> 00:02:28,550 do so from the Congo. 25 00:02:28,580 --> 00:02:37,470 It will still render as we increasing the where it was of can a in order to increase the performance 26 00:02:37,500 --> 00:02:46,170 of the M if we do not want the component 8 we render every time we can use to use mambo. 27 00:02:46,200 --> 00:02:54,150 So we also import the U.S. Mambo from we add and then we create a memo component a 28 00:03:03,350 --> 00:03:06,480 copy the component 8 and paste it here. 29 00:03:06,640 --> 00:03:15,140 Now you step are using the computer on a here we are going to use the memo computer an a and just like 30 00:03:15,140 --> 00:03:21,490 they use effect we are going to render once so we add the square brackets here. 31 00:03:21,520 --> 00:03:29,590 Now no matter how you approach the increment a buttons this really does render one time only you'll 32 00:03:29,620 --> 00:03:34,150 see the zero because our initial stage here is zero. 33 00:03:34,740 --> 00:03:41,090 Maybe we change it to one because it must have to render one time at least. 34 00:03:41,490 --> 00:03:47,760 So now you can see it will not be Randa even we keep pressing the buttons.