MCPcopy Create free account
hub / github.com/alibaba/hooks

github.com/alibaba/hooks

Chat with this repo
repository ↗ · DeepWiki ↗ · release v3.10.0 ↗ · + Follow · compare 2 versions
665 symbols 2,407 edges 422 files 2 documented · 0% updated todayv3.10.0 · 2026-09-06★ 14,97665 open issues

Browse by type

Functions 538 Types & classes 127
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

一套高质量可靠的 React Hooks 库

NPM version NPM downloads npm Coverage Status npm gzip size Percentage of issues still open Average time to resolve an issue GitHub

English | 简体中文

📚 文档

公告

use-url-state 已改为使用新包名 @ahooks.js/use-url-state 发布。

如果你正在安装或升级这个包,请使用新的包名。

✨ 特性

  • 易学易用
  • 支持 SSR
  • 对输入输出函数做了特殊处理,避免闭包问题
  • 包含大量提炼自业务的高级 Hooks
  • 包含丰富的基础 Hooks
  • 使用 TypeScript 构建,提供完整的类型定义文件

📦 安装

$ npm install --save ahooks
# or
$ yarn add ahooks
# or
$ pnpm add ahooks
# or
$ bun add ahooks

🔨 使用

import { useRequest } from "ahooks";

💻 在线体验

Edit demo for ahooks

🤝 参与共建

$ git clone git@github.com:alibaba/hooks.git
$ cd hooks
$ pnpm run init
$ pnpm start

打开浏览器访问 http://127.0.0.1:8000

我们欢迎所有人参与共建,请参考CONTRIBUTING.MD

感谢所有贡献者:

contributors

👥 交流讨论

ahooks discussion group 1 ahooks discussion group 2 ahooks discussion group 3

Extension points exported contracts — how you extend this code

browse all types & interfaces →

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 515
Interface 105
Method 23
Class 18
Enum 4

Languages

TypeScript100%

Modules by API surface

packages/hooks/src/useLongPress/index.ts18 symbols
packages/hooks/src/useSelections/index.ts11 symbols
packages/hooks/src/useRequest/src/Fetch.ts11 symbols
packages/hooks/src/useFullscreen/index.ts11 symbols
packages/hooks/src/useAntdTable/index.tsx10 symbols
packages/hooks/src/useAntdTable/__tests__/index.spec.ts10 symbols
packages/hooks/src/createUseStorageState/__tests__/index.spec.ts10 symbols
packages/hooks/src/useWebSocket/index.ts9 symbols
packages/hooks/src/useHistoryTravel/index.ts9 symbols
packages/hooks/src/useCounter/index.ts9 symbols
packages/hooks/src/utils/index.ts8 symbols
packages/hooks/src/useNetwork/index.ts8 symbols

Dependencies from manifests, versioned

@alifd/next1.27.32 · 1×
@ant-design/icons6.1.1 · 1×
@babel/cli7.10.1 · 1×
@babel/core7.10.2 · 1×
@babel/plugin-transform-runtime7.19.6 · 1×
@babel/runtime7.21.0 · 1×
@biomejs/biome2.0.6 · 1×
@commitlint/cli17.1.2 · 1×
@commitlint/config-conventional17.1.0 · 1×
@testing-library/react16.3.0 · 1×
@types/js-cookie3.0.6 · 1×
@types/lodash4.17.20 · 1×

For agents

$ claude mcp add hooks \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page