ahooks is a React Hooks library with basic and advanced hooks for common UI and data patterns. It supports SSR and is written in TypeScript.
Overview
ahooks packages reusable React Hooks for everyday front-end work and more specialized scenarios refined from business use cases. The library is straightforward to learn, ships with predictable static types because it is written in TypeScript, and documents usage in English and Chinese.
The library includes a broad set of foundational hooks plus higher-level utilities, with special handling around functions to reduce stale closure issues. Server-side rendering is supported for teams that hydrate React apps on the server.
Install published packages through npm in React projects, then import the hooks you need. URL state synchronization is noted as moving to a separate package name (`@ahooksjs/use-url-state`) for new installs or upgrades.
Online documentation and demos are available, and maintainers welcome community contributions through a published contribution guide.
Key features
- Large catalog of React Hooks
- TypeScript typings
- SSR-compatible hooks
- Closure-safe function handling
- Basic and advanced hook sets
- English and Chinese docs
- npm package distribution
- Business-oriented utility hooks
Use cases
- Shared React state and effect patterns
- SSR React applications
- Reducing custom hook boilerplate
- Typed hook utilities in TypeScript