@knitui/hooks
useTimeout
Declarative setTimeout with automatic cleanup — port of Mantine's useTimeout. The callback is read through a ref so a re-render never restarts a pending timer, and any pending timer is cleared on unmount. Replaces the hand-rolled blurTimer ref + cleanup-effect pattern; pure timers, so identical on web and native.
WebiOSAndroid
Import
import { useTimeout } from "@knitui/hooks";Signature
export function useTimeout( callback: (...args: unknown[]) => void, delay: number, options: UseTimeoutOptions = {}, ): UseTimeoutReturnExported types: UseTimeoutOptions, UseTimeoutReturn