Functions & Hooks

createClock

function createClock(): Clock;

useClock with no React: seconds since creation as a SharedValue, written on the UI thread, for driving a shader uniform on any target - a canvas or an offscreen surface. Call stop() when done; the loop otherwise runs for the process's life.

Needs react-native-reanimated, exactly as the hook does: without a UI runtime there is nothing to write the value.

Returns

Clock

On this page