You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your setInterval is updating the value at least every frame. If you want to update this way, increasing by 100 every ~10 milliseconds, do not use CountUp, because the setInterval will render the DOM about as often as requestAnimationFrame.
RequestAnimationFrame runs as often as your browser allows, usually between 30-60 FPS. setInterval used with a time value lower than the max FPS of your browser will effectively do the same.
As a side note, don't use ref.current in the dependency array of useEffect.
The actual usage scenario is batch deletion. Each time the interface is called, 100 files can be deleted. After the deletion is successful, the interface is called again to delete the files. The front end accumulates and counts the number of files that have been successfully deleted. The interface response time is not fixed, so this problem still exists and occurs occasionally.
Description
When the update method is called more frequently than requestAnimationFrame, NaN will be rendered:
The text was updated successfully, but these errors were encountered: