# @billogram/use-click-outside

> > A React hook for handling clicks outside of an element

Latest version **1.2.0** (published 2021-01-10) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @billogram/use-click-outside
pnpm add @billogram/use-click-outside
yarn add @billogram/use-click-outside
bun add @billogram/use-click-outside
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2021-01-10 |
| First published | 2020-01-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | mrydengren, andreashogstrom, ewakosciukiewicz, miriamlarsson |

## Links

- npm: https://www.npmjs.com/package/@billogram/use-click-outside
- npm.io page: https://npm.io/package/@billogram/use-click-outside

## Dependencies (1)

- [react](https://npm.io/package/react.md) ^17.0.1

## Recent versions

- 1.2.0 (latest) — 2021-01-10
- 1.1.0 — 2020-05-26
- 1.0.1 — 2020-03-19
- 1.0.0 — 2020-01-20

## README

# @billogram/use-click-outside

> A React hook for handling clicks outside of an element

## Install

```
yarn add @billogram/use-click-outside
```

## Usage

```tsx
import useClickOutside from '@billogram/use-click-outside';
```

See [types](src/types.ts) for exported types.

### [`useClickOutside`](src/useClickOutside.ts)

```tsx
const node = React.useRef<HTMLDivElement>(null);
useClickOutside(node, function onClickOutside() {
    // do something when a click outside event occurs
});
```

## Note

This library is being published with our use cases in mind and is not necessarily meant to be consumed by the broader public. We probably won't take your feature requests unless they align with our own needs.

## License

MIT

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