What problem does it solve?
ahooks prevents subtle bugs and inconsistencies that come from hand-rolling common React hook patterns like debounce, throttling, event listeners, and controlled/uncontrolled state management.
Core Features & Use Cases
- When to use ahooks: Choose ahooks hooks whenever the behavior matches a known pattern (e.g., controlled inputs, debounced search, resize observers), instead of writing a custom hook.
- Practical hook categories: Covers state/control helpers, effect utilities (debounce/throttle, async safety), lifecycle helpers, and DOM/observer hooks.
- Monorepo usage rule: Install it in the consuming app (not shared UI) so UI primitives do not pull ahooks transitively.
Quick Start
Use the ahooks guidance to pick the correct hook for your React/Next.js need (for example, replace a custom debounce implementation with ahooks useDebounceFn in the feature’s consuming app).