Skip to content

Latest commit

 

History

History

use-debounced

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

use-debounced

Stable release

A React hook to debounce the provided value in render. If delay is zero, the value is updated synchronously.

Example

function DebouncedValue() {
  const debouncedValue = useDebounced('Hello', 100);
  return <p>{debouncedValue}</p>;
}

This will initially render an empty text (since debouncedValue is undefined) and after 100ms the rendered value will be changed to Hello.