@danixsoft/hooks vs ahooks
The short answer
ahooks, maintained by Alibaba, is a large and well-engineered hooks library whose standout feature is useRequest — a fully featured async manager with caching, polling, retries and debouncing built in. @danixsoft/hooks is smaller and simpler, with zero runtime dependencies and a basic useFetch rather than a request framework. Choose ahooks if you want its async layer; choose @danixsoft/hooks if you want lean utilities and prefer a dedicated library like TanStack Query for data fetching.
ahooks is not really a competitor to a utility hook collection — it is closer to a framework with a hooks-shaped API. That distinction determines which one you should install.
Different problems, similar packaging
useRequest is the real decision
Nearly every ahooks-versus-alternative decision comes down to one hook. useRequest handles caching, polling, retries, debouncing, dependent requests, manual triggering and loading-state delays — a genuinely large amount of behaviour that most applications need in some form.
Our useFetch does not attempt that. It gives you data, error and loading, and aborts the request when the URL changes or the component unmounts. That is the right size for a utility library and clearly not enough for a data-heavy application.
The third option
If you want a serious async layer, TanStack Query is more capable than either library's built-in offering — request deduplication, background refetching, optimistic updates and a devtools panel. Pairing TanStack Query with a lean utility library is a common and effective combination.When ahooks is the better fit
- You want `useRequest` specifically and do not want to add a separate data library.
- You are already in the Ant Design ecosystem, where ahooks is the natural companion.
- Your team reads Chinese documentation, which is first-class rather than a translation.
- You want a large toolkit from one vendor with a single support surface.
When the leaner library is the better fit
- You already use TanStack Query or SWR. Adding ahooks means two async layers competing for the same job.
- Zero runtime dependencies is a requirement, not a preference.
- You want utilities, not a framework. Adopting a framework-shaped library is a bigger architectural commitment than installing a few hooks.
- Your app is touch-heavy. Swipe, touch and pointer hooks are first-class here.
Key takeaway
Ask what you want the library to own. If the answer includes your data-fetching architecture, ahooks or TanStack Query. If it is small stateful UI logic, a lean utility collection is the better shape.
Can I use ahooks and @danixsoft/hooks together?
Yes. Both are tree-shakeable, so importing useRequest from one and useSwipe from the other costs only those hooks. Just avoid using both libraries' versions of the same hook in one codebase — pick one per concern so behaviour stays predictable.
Does @danixsoft/hooks plan to add caching and polling to useFetch?
No. Doing that properly means request deduplication, cache invalidation and background refetching, which is a different library. TanStack Query already does it well, and duplicating it badly would serve nobody.
Is ahooks only for Ant Design projects?
No, it works in any React application. The Ant Design association reflects a shared maintainer, not a technical coupling.
Keep reading
@danixsoft/hooks vs react-use
react-use is the largest React hooks collection ever published. Here is when that breadth helps you and when a smaller, typed, dependency-free library is the better call.
@danixsoft/hooks vs @mantine/hooks
Mantine ships an excellent hooks package alongside its component library. Here is when to take it standalone and when a UI-agnostic collection fits better.