Shadcn.io is not affiliated with official shadcn/ui
React useDebounceCallback Hook
React useDebounceCallback hook with cancel, flush, and isPending controls. Lodash debounce under the hood. TypeScript ready.
Debounce any callback in React without stale closure issues. useDebounceCallback wraps your function with lodash debounce and returns cancel, flush, and isPending controls. Configurable delay (default 500ms), leading/trailing edge, and maxWait options. Auto-cancels on unmount to prevent memory leaks. Perfect for search inputs, autocomplete, form validation, or any rapid-fire event handler. Works with Next.js App Router and SSR. Use useDebounceValue if you need debounced state instead of a debounced function.
React useDebounceCallback Hook preview
Installation
Related Components
React useDebounceValue Hook
Debounce state values
React useThrottle Hook
Throttle rapid function calls
React useTimeout Hook
Declarative setTimeout management
React useInterval Hook
Declarative setInterval management
React useEventCallback Hook
Stable callback reference
React useUnmount Hook
Run cleanup on unmount
FAQ
Was this page helpful?
Sign in to leave feedback.