Leave Yamada UI a star

Star
Yamada UIYamada UIv1.7.2

useInterval

useInterval is a custom hook that runs a function at a specified interval.

Source@yamada-ui/use-interval

Import

import { useInterval } from "@yamada-ui/react"
Copied!

Usage

Editable example

const [state, setState] = useState<number>(1)

useInterval(() => setState((prev) => prev + 1), 3000)

return <Text>Current state: {state}</Text>
Copied!

Edit this page on GitHub

PrevioususeInfiniteScrollNextuseLoading