A debounce hook for react
debounceOnServer
: if you put the option to true, it will run debouncing on server (via setTimeout). The new option can break your current server behaviour, as v9.x, it runs all the time and might cause unnessesary server CPU utilisation. Now, by default, debounced callbacks do not happen on server.testing-library
Fix the bug with the incorrect import path. Now it's index.cjs, instead of index.js
useDebouncedCallback
args: https://github.com/xnimorz/use-debounce/pull/140 Thanks to @sarunast
types
to package json to mitigate https://github.com/microsoft/TypeScript/issues/49160. https://github.com/xnimorz/use-debounce/pull/138 Thanks to @wuzzeb
Added jest@28 support
useDebounce
changed its build system to microbundle. For now we have several entries:index.js
is for commonJS approach
index.modern.js
for esnext module system
index.umd.js
for UMD.
All the files are in dist
folder.
If you have any paths which have esm
or lib
, please, replace them to dist
:
Before:
import useDebounceCallback from 'use-debounce/lib/useDebounceCallback'
After:
import { useDebounceCallback } from 'use-debounce';
useDebounce
behaviour with react-devtools tab when devtools have a component with useDebounce
or useDebounceCallback
opened. https://github.com/xnimorz/use-debounce/issues/129 Thanks to @alexniarchos for reportingleading: true
https://github.com/xnimorz/use-debounce/issues/124 Thanks to @mntnoe for reporting