useAnimationFrame
Registers a callback to be called on every animation frame as long as the component is visible to the user.
Arguments
callback: A function to be called on every animation frame with a single argument,timeMs: number. The function will receive the current timestamp as an argument.
Returns
No return value.