Skip to main content
Version: 0.3.0

useDebounce

Returns a debounced copy of a value — the copy only updates after the specified delay has elapsed since the last change.

Signature​

function useDebounce<T>(value: T, delay?: number): T

Parameters​

ParameterTypeDefaultDescription
valueT—The value to debounce
delaynumber500Milliseconds to wait after the last change

Return value​

The debounced value of type T. It will always equal the initial value on the first render.

Live example​

Loading playground...