# react-outside-events

> Handle events outside of element

Latest version **1.0.4** (published 2018-10-20) · MIT license · 0 weekly downloads

## Install

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

## 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.4 |
| Published | 2018-10-20 |
| First published | 2018-10-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 14.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Constantine Oupirum |
| Maintainers | oupirum |
| Keywords | react, outside, event, handle, click, touch |

## Links

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

## Dependencies (2)

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

## 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.4 (latest) — 2018-10-20
- 1.0.3 — 2018-10-09
- 1.0.2 — 2018-10-07
- 1.0.1 — 2018-10-07
- 1.0.0 — 2018-10-07

## README

# react-outside-events

Handle events outside of element

### Install:
```
npm install --save react-outside-events
```

### How to use:
```
import {OutsideEvents} from 'react-outside-events';

class App extends Component {
  render() {
    return (
      <div>
        <p>
          Some page content
        </p>

        <OutsideEvents on={{
            click: (event) => {
              console.debug('handle click');
            },
            touchstart: (event) => {
              console.debug('handle touch');
            },
            {/* or any other event */}
            {/*
              These event handlers will be triggered
              when you click|touch anywhere on the page
              but not on the `<p>Something</p>`
            */}
        }}>
          <p>
            Something
          </p>
        </OutsideEvents>

        <p>
          Some page content
        </p>
      </div>
    );
  }
```

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