MCPcopy
hub / github.com/alibaba/hooks

github.com/alibaba/hooks @v3.9.7 sqlite

repository ↗ · DeepWiki ↗ · release v3.9.7 ↗
621 symbols 2,296 edges 420 files 2 documented · 0%
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 | 简体中文

📚 文档

✨ 特性

  • 易学易用
  • 支持 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

👥 交流讨论

Extension points exported contracts — how you extend this code

Options (Interface)
(no doc)
packages/use-url-state/src/index.ts
Window (Interface)
(no doc)
packages/hooks/src/global.d.ts
CursorState (Interface)
(no doc)
packages/hooks/src/useMouse/index.ts
Rect (Interface)
(no doc)
packages/hooks/src/useTextSelection/index.ts
State (Interface)
(no doc)
packages/hooks/src/useTextSelection/index.ts
LoadResult (Interface)
(no doc)
packages/hooks/src/useExternal/index.ts

Core symbols most depended-on inside this repo

useMemoizedFn
called by 63
packages/hooks/src/useMemoizedFn/index.ts
sleep
called by 58
packages/hooks/src/utils/testingHelpers.ts
setState
called by 57
packages/hooks/src/useControllableValue/index.ts
setState
called by 53
packages/hooks/src/useRequest/src/Fetch.ts
run
called by 47
packages/hooks/src/useRequest/src/Fetch.ts
useRequest
called by 43
packages/hooks/src/useRequest/src/useRequest.ts
useKeyPress
called by 35
packages/hooks/src/useKeyPress/index.ts
setValue
called by 33
packages/hooks/src/useCounter/index.ts

Shape

Function 489
Interface 101
Method 17
Class 10
Enum 4

Languages

TypeScript100%

Modules by API surface

packages/hooks/src/useSelections/index.ts11 symbols
packages/hooks/src/useRequest/src/Fetch.ts11 symbols
packages/hooks/src/useLongPress/index.ts11 symbols
packages/hooks/src/useFullscreen/index.ts11 symbols
packages/hooks/src/useAntdTable/index.tsx10 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/useAntdTable/__tests__/index.spec.ts9 symbols
packages/hooks/src/createUseStorageState/__tests__/index.spec.ts9 symbols
packages/hooks/src/useNetwork/index.ts8 symbols
packages/hooks/src/useDrop/index.ts8 symbols

Dependencies from manifests, versioned

@alifd/next1.27.32 · 1×
@ant-design/icons5.6.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