Will have to update intervalFun so that it will have the last timeoutValue for clearing#9
Conversation
|
@rajanlagah please check once |
|
@nautiyalshubham002
This code is old and not I am thinking all the functions should come inside useEffect ( MeasureConnectionSpeed, startCalculating ) and that will fix clearing timeout issue. Pls let me know if you going to pick this up. |
|
@rajanlagah lets take an example at line 31 when component is mount we are but in unmounting we are clearing 121 (the interval already executed) so we have to assign latest timeout value in intervalFun |
|
@nautiyalshubham002 |
|
@rajanlagah I have also checked this by running this |
|
@nautiyalshubham002 |
|
I don't think we have to do that much just by updating intervalFun we can resolve it https://codesandbox.io/p/sandbox/3vyv3r visit this once |
Will have to update intervalFun so that it will have the last timeoutValue for clearing otherwise it will be getting called recursively