# use-click-away-listener

> React hook to detect click away events

Latest version **1.0.0** (published 2020-02-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install use-click-away-listener
pnpm add use-click-away-listener
yarn add use-click-away-listener
bun add use-click-away-listener
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-02-04 |
| First published | 2020-02-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=8 |
| Dependencies | 0 |
| Unpacked size | 560.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | paytonbox |
| Maintainers | paytonbox |

## Links

- npm: https://www.npmjs.com/package/use-click-away-listener
- Repository: https://github.com/paytonbox/use-click-away-listener
- Homepage: https://github.com/paytonbox/use-click-away-listener#readme
- Issues: https://github.com/paytonbox/use-click-away-listener/issues
- npm.io page: https://npm.io/package/use-click-away-listener

## Recent versions

- 1.0.0 (latest) — 2020-02-04

## README

# use-click-away-listener

> React hook to detect click away events

[![NPM](https://img.shields.io/npm/v/use-click-away-listener.svg)](https://www.npmjs.com/package/use-click-away-listener) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save use-click-away-listener
```

## Usage

```jsx
import React from 'react'

import useClickAwayListener from 'use-click-away-listener'

const handleClickAway = () => {
  // your code here
}

const Example = () => {
  const myClickAwayRef = useClickAwayListener(handleClickAway)
  
  return (
    <div ref={myClickAwayRef}>Click Anywhere But Here</div>
  )
}
```

## License

MIT © [paytonbox](https://github.com/paytonbox)

---

This hook is created using [create-react-hook](https://github.com/hermanya/create-react-hook).

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