# react-outside

> A higher order component for React for listening to clicks outside of the component. Supports classes and decorators.

Latest version **1.0.2** (published 2016-08-09) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2016-08-09 |
| First published | 2016-08-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Dan Bovey |
| Maintainers | danbovey |
| Keywords | react, outside, click, event |

## Links

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

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2016-08-09
- 1.0.1 — 2016-08-05
- 1.0.0 — 2016-08-05

## README

React Outside
=======================

[![npm](https://img.shields.io/npm/dt/react-outside.svg?style=flat-square)](https://www.npmjs.com/package/react-outside)
[![React Version](https://img.shields.io/badge/React-%5E15.0.1-blue.svg?style=flat-square)](https://www.npmjs.com/package/react)
[![npm](https://img.shields.io/npm/v/react-outside.svg?style=flat-square)](https://www.npmjs.com/package/react-outside)
[![npm](https://img.shields.io/npm/l/react-outside.svg?style=flat-square)](https://github.com/danbovey/react-outside/blob/master/LICENSE)

A higher order component for React for listening to clicks outside of the component. Supports classes and decorators.

## Installation

```
  npm i react-outside
```

## How to use

### Config

```js
/**
 * @param {Object} config Configuration for the events.
 * @return {Component}
 */
 ```

### Usage

```js
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import clickOutside from 'react-outside';

@clickOutside(['mousedown']) // `click` is the default handler but you can set different event names
export default class DropdownMenu extends Component {
	handleClickOutside(e) {
		// Handle the event
	}

	render() {
		return (
			<ul className="dropdown-menu">
				<li>List items...</li>
			</ul>
		);
	}
}
```

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