# @kne/use-blur

> 复合表单组件控制blur事件

Latest version **0.1.0** (published 2020-05-09) · ISC license · 0 weekly downloads

## Install

```sh
npm install @kne/use-blur
pnpm add @kne/use-blur
yarn add @kne/use-blur
bun add @kne/use-blur
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2020-05-09 |
| First published | 2020-05-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 26.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | linzp |
| Maintainers | lingtong |
| Keywords | hooks, blur, form |

## Links

- npm: https://www.npmjs.com/package/@kne/use-blur
- Repository: https://github.com/kne-union/use-blur
- Homepage: https://github.com/kne-union/use-blur#readme
- Issues: https://github.com/kne-union/use-blur/issues
- npm.io page: https://npm.io/package/@kne/use-blur

## Dependencies (1)

- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.7.7

## 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.1.0 (latest) — 2020-05-09

## README

# useBlur
复合表单组件控制blur事件

```shell script
npm i @kne/use-blur
```

# 使用说明

```jsx
import useBlur from '@kne/use-blur';

const SomeComponent = ()=>{
  const ref = useBlur(()=>{
    console.log('onBlur trigger');
  });
  return (
    <span ref={ref}>
      <input type="text"/>
      <input type="text"/>
    </span>
  );
};
```
上述示例组件中，SomeComponent组件中的任何一个元素触发focus然后点击组件外部区域都会触发onBlur，而在两个input之间来回focus不会触发onBlur

一般用于捕捉form的复合组件形成的field的校验时机

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