1 | <p align="center">
|
2 | <a href="https://ahooks.js.org">
|
3 | <img width="200" src="https://ahooks.js.org/logo.svg">
|
4 | </a>
|
5 | </p>
|
6 |
|
7 | <div align="center">
|
8 |
|
9 | A high-quality & reliable React Hooks library.
|
10 |
|
11 | [![NPM version][image-1]][1]
|
12 | [![NPM downloads][image-2]][2]
|
13 | [![npm](https://img.shields.io/npm/dw/ahooks-v2?label=downloads%28v2%29)](https://www.npmjs.com/package/ahooks-v2)
|
14 | [![npm](https://img.shields.io/github/issues/alibaba/hooks)](https://github.com/alibaba/hooks/issues)
|
15 | [![Coverage Status](https://coveralls.io/repos/github/alibaba/hooks/badge.svg?branch=master)](https://coveralls.io/github/alibaba/hooks?branch=master)
|
16 | ![gzip size](https://img.badgesize.io/https:/unpkg.com/ahooks/dist/ahooks.js?label=gzip%20size&compression=gzip)
|
17 | [![Percentage of issues still open](http://isitmaintained.com/badge/open/alibaba/hooks.svg)](http://isitmaintained.com/project/alibaba/hooks 'Percentage of issues still open')
|
18 | [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/alibaba/hooks.svg)](http://isitmaintained.com/project/alibaba/hooks 'Average time to resolve an issue')
|
19 | ![GitHub](https://img.shields.io/github/license/alibaba/hooks)
|
20 |
|
21 | English | [简体中文](https://github.com/alibaba/hooks/blob/master/README.zh-CN.md)
|
22 |
|
23 | </div>
|
24 |
|
25 | ## 📚 Documentation
|
26 |
|
27 | - [English](https://ahooks.js.org/)
|
28 | - [中文](https://ahooks.js.org/zh-CN/)
|
29 |
|
30 | ## ✨ Features
|
31 |
|
32 | - Easy to learn and use
|
33 | - Supports SSR
|
34 | - Special treatment for functions, avoid closure problems
|
35 | - Contains a large number of advanced Hooks that are refined from business scenarios
|
36 | - Contains a comprehensive collection of basic Hooks
|
37 | - Written in TypeScript with predictable static types
|
38 |
|
39 | ## 📦 Install
|
40 |
|
41 | ```bash
|
42 | $ npm install --save ahooks
|
43 | # or
|
44 | $ yarn add ahooks
|
45 | # or
|
46 | $ pnpm add ahooks
|
47 | # or
|
48 | $ bun add ahooks
|
49 | ```
|
50 |
|
51 | ## 🔨 Usage
|
52 |
|
53 | ```ts
|
54 | import { useRequest } from 'ahooks';
|
55 | ```
|
56 |
|
57 | ## 💻 Online Demo
|
58 |
|
59 | [![Edit demo for ahooks](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/demo-for-ahooks-forked-fg79k?file=/src/App.js)
|
60 |
|
61 | ## 🤝 Contributing
|
62 |
|
63 | ```bash
|
64 | $ git clone git@github.com:alibaba/hooks.git
|
65 | $ cd hooks
|
66 | $ pnpm run init
|
67 | $ pnpm start
|
68 | ```
|
69 |
|
70 | Open your browser and visit http://127.0.0.1:8000
|
71 |
|
72 | We welcome all contributions, please read our [CONTRIBUTING.MD](https://github.com/alibaba/hooks/blob/master/CONTRIBUTING.MD) first, let's build a better hooks library together.
|
73 |
|
74 | Thanks to all the contributors:
|
75 |
|
76 | <a href="https://github.com/alibaba/hooks/graphs/contributors">
|
77 | <img src="https://opencollective.com/ahooks/contributors.svg?width=960&button=false" alt="contributors" />
|
78 | </a>
|
79 |
|
80 | ## 👥 Discuss
|
81 |
|
82 | <img src="https://github.com/alibaba/hooks/assets/49217418/ba636378-1dff-4754-bfe6-46923417cd3b" width="200" style='display:inline' /><img src="https://github.com/alibaba/hooks/assets/49217418/93a169ce-f9d1-4a66-a829-9f16e790ee28" width="200" style='display:inline' /><img src="https://github.com/alibaba/hooks/assets/49217418/d30d80c7-eb16-4522-acab-f2d48513464a" width="200" style='display:inline' />
|
83 |
|
84 | [1]: https://www.npmjs.com/package/ahooks
|
85 | [2]: https://npmjs.org/package/ahooks
|
86 | [image-1]: https://img.shields.io/npm/v/ahooks.svg?style=flat
|
87 | [image-2]: https://img.shields.io/npm/dw/ahooks.svg?style=flat
|