Skip to main content
Version: Next (Unreleased)

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
valueTThe 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...