# react-ihooks

> react函数库

Latest version **0.2.7** (published 2022-03-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-ihooks
pnpm add react-ihooks
yarn add react-ihooks
bun add react-ihooks
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.7 |
| Published | 2022-03-07 |
| First published | 2022-03-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 416.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 20 |
| Author | 广东靓仔 |
| Maintainers | feng_007 |
| Keywords | react-ihooks, react, hook, typescript, javascript |

## Links

- npm: https://www.npmjs.com/package/react-ihooks
- Repository: https://github.com/00feng00/ihooks
- Homepage: https://github.com/00feng00/ihooks#readme
- Issues: https://github.com/00feng00/ihooks/issues
- npm.io page: https://npm.io/package/react-ihooks

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.2.7 (latest) — 2022-03-07
- 0.2.6 — 2022-03-05

## README

# API文档
[文档预览](https://react-ihooks.github.io/) <br />

<a href="https://react-ihooks.github.io"><img src='https://github.com/00feng00/ihooks/blob/main/src/assets/react-ihooks_logo.png' width="100" /></a>

# 安装
```
npm install react-ihooks
```


## Demo
设置浏览器页面标题Demo:

## useDocumentTitle
demo

```tsx
import React from 'react';
import { useDocumentTitle } from 'react-ihooks';

export default () => {
  useDocumentTitle('页面标题');

  return (
    <div>
      <p>为页面设置标题</p>
    </div>
  );
};
```
## useDebounce

定制处理防抖： 
·动态设置等待时间 
·是否开启在延迟开始前调用函数 
·是否开启在延迟开始后调用函数 
·最大等待时间

```tsx
import React, { useState } from 'react';
import { useDebounce } from 'react-ihooks';

export default () => {
  const [value, setValue] = useState<string>();
  const debouncedValue = useDebounce(value, { wait: 200 });

  return (
    <div>
      <input
        value={value}
        onChange={(e) => setValue(e.target.value)}
        placeholder="请输入信息"
        style={{ width: 380 }}
      />
      <p style={{ marginTop: 16 }}>DebouncedValue: {debouncedValue}</p>
    </div>
  );
};
```

# 技术交流
欢迎关注“前端早茶”，与广东靓仔技术交流～<br />
<img src='https://avatars.githubusercontent.com/u/18207644?v=4' width='200' style="border: 1px solid #036cb9;" />
<img src='https://camo.githubusercontent.com/cd50eb85ab332891faee0c34486e9921f63bd1bd1da12e246dd7f3f83814b6be/68747470733a2f2f303066656e6730302e6769746875622e696f2f696d672f71647a635f6c6f676f2e6a7067'  width='200' style="border: 1px solid #036cb9;" />

---
_Source: https://npm.io/package/react-ihooks · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
