use-debounced-value
Debounce value changes
Import
Source
Docs
Package
Usage
Use hook to debounce value change. This can be useful in case you want to perform a heavy operation based on react state, for example, send search request.
Value: [empty string]
Debounced value: [empty string]
Leading update
You can immediately remove the previously updated value with { leading: true }
options:
Value: [empty string]
Debounced value: [empty string]
Cancel update
Hook provides cancel callback, you can use it to cancel update. Update cancels automatically on component unmount.
In this example, type in some text and click cancel button within a second to cancel debounced value change:
Value: [empty string]
Debounced value: [empty string]
Definition
Feedback
Your feedback is most valuable contribution to the project, please share how you use Mantine, what features are missing and what is done good
Leave feedback