Skip to main content
100%

Repeater triggers the onRepeat event multiple times at the speed interval.

✓ Published0🌍 Public
Aabonello
Last edited May 19, 2021
Created on Dec 30, 2021

This example demonstrates how a React `Repeater` component triggers its `onRepeat` callback repeatedly at a fixed `speed` interval, simulating a continuous animation loop. The component uses React’s `useEffect` hook to set up a `setInterval` that fires `onRepeat` at the specified millisecond rate, while respecting a `disabled` prop and an optional `emitFirst` flag that triggers the callback once immediately. It renders no visible output, serving purely as a timing utility. The example shows the `Repeater` API in action, where the interval is cleared on unmount or when dependencies change.

AI-generated description

Similar vizzes