useTimeout

A declarative wrapper around setTimeout that manages cleanup automatically.

A declarative wrapper around setTimeout that automatically handles cleanup on unmount or delay changes. Pass null as the delay to disable the timeout.

Import#

import { useTimeout } from '@volue/wave-react';

Example#


API Reference#

Arguments#

Prop
Type
Default
callback*
(...args: any[]) => void
delay*
number | null

Returns#

void