useAnimationFrame
Handle the requestAnimationFrame (opens in a new tab) API to call a function on every frame render.
Type Definitions
const useAnimationFrame: (args: {
callback: FrameRequestCallback;
startOnMount?: boolean;
}) => {
start: () => void;
cancel: () => void;
toggle: (start?: boolean) => void;
isStarted: boolean;
};