Leave Yamada UI a star

Star
Yamada UIYamada UIv1.7.2

useTimeout

useTimeout is a custom hook that executes a function after a specified number of milliseconds.

Source@yamada-ui/use-timeout

Import

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

Usage

Editable example

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

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

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

Edit this page on GitHub

PrevioususeThemeNextuseToken