In we at the computer will we render even the changing of state is not related to them.
To demonstrate this we can create a button component and a stage for us.
We are going to enforce the state farm we ate.
Then we can go to create a state count a and set time.
8 We will also create can be and set can be later so we name it as a first.
Then we go to create a increment functions which is using to increase the awareness of can a and inside
the grant up on the site.
And we are going to display the value of a.
So we are going to type it empty as young age and also this trade a conk a rarely loose and then we
are going to add a button so you can trigger to increment a functions to increase the value of count
a.
So after we create the buttons we are going to create a component.
So we added photos called components and we added components a G S
in order to count the number of times that it renders.
We are going to import that use e fat and we let the red dot com initial radio is zeros and anxiety
can put on a we used to use fat.
We will not add the square brackets so it will render every time it the component a was triggered and
every time it was triggered or rendered we are going to add the radio of the render account and inside
the render function we are going to display the number of when the times
and then we back to the J as and then we import the component eight
from the component a
and then under the paragraph we import the component eight.
Now if we try on cooking to increment A you will see although the component a do not receive anywhere
do so from the Congo.
It will still render as we increasing the where it was of can a in order to increase the performance
of the M if we do not want the component 8 we render every time we can use to use mambo.
So we also import the U.S. Mambo from we add and then we create a memo component a
copy the component 8 and paste it here.
Now you step are using the computer on a here we are going to use the memo computer an a and just like
they use effect we are going to render once so we add the square brackets here.
Now no matter how you approach the increment a buttons this really does render one time only you'll
see the zero because our initial stage here is zero.
Maybe we change it to one because it must have to render one time at least.
So now you can see it will not be Randa even we keep pressing the buttons.