useRaf
About
A continuously running requestAnimationFrame hook for React
Examples
Basic example
Arguments
Argument value | Type | Description | Default value |
---|---|---|---|
callback | (timeElapsed: number) => void | The callback function to be executed. timeElapsed is the time in ms since the last raf call. | undefined |
isActive | boolean | The value which while true, keeps the raf running infinitely | undefined |
Returns
No return value.