useInterval
useInterval
is a custom hook that runs a function at a specified interval.
Import
import { useInterval } from "@yamada-ui/react"
Usage
Editable example
const [state, setState] = useState<number>(1) useInterval(() => setState((prev) => prev + 1), 3000) return <Text>Current state: {state}</Text>
Edit this page on GitHub