Most of the time you don't need to use this hook directly. The Input and Textarea components already use it internally when `maxLength` is set. Use this hook when you need custom debouncing logic in your own components.
Features
- Delays value updates until user stops typing
- Prevents excessive API calls or computations
- Simple and lightweight implementation
- Works with any value type
Basic usage
With API calls
With expensive computations
API Reference
Return value
Common use cases
Search inputs
Form validation
Window resize handling
Performance tips
- Choose appropriate delay: 300-500ms for search, 100-200ms for UI feedback
- Combine with useMemo: Debounce input, then memoize expensive computations
- Cancel pending requests: Clean up API calls when component unmounts