Rehooks
Hooks

useDebounceValue

A custom hook that debounces a value, returning the value after the specified delay.

useDebounceValue

A custom hook that debounces a value, returning the value after the specified delay.

Usage

import { useDebounceValue } from "rehooks-ts";
 
const debouncedSearchTerm = useDebounceValue(searchTerm, 500);

API

useDebounceValue

function useDebounceValue<T>(value: T, delay: number): T;

Parameters

NameTypeDescription
valueTThe value to debounce.
delaynumberThe debounce delay in milliseconds.

Returns

NameTypeDescription
debouncedValueTThe debounced value.

On this page