use-debounced
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i use-debounced

Weekly Downloads

10

Version

1.1.0

License

MIT

Unpacked Size

11.3 kB

Total Files

12

Last publish

Collaborators

  • amann