https://github.com/javierbyte/react-clickaway
Clickaway mixin for react, based on https://github.com/callemall work
https://github.com/javierbyte/react-clickaway
Last synced: 2 months ago
JSON representation
Clickaway mixin for react, based on https://github.com/callemall work
- Host: GitHub
- URL: https://github.com/javierbyte/react-clickaway
- Owner: javierbyte
- Created: 2015-06-15T17:51:48.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-02-10T03:33:04.000Z (over 9 years ago)
- Last Synced: 2025-04-17T15:13:40.560Z (3 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 7
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# React Clickaway
Mixin that adds a `componentClickAway` method to react components that fires the you click away from it.
## Installation
```
npm install react-clickaway --save
```Add it to your component
```js
mixins: [
require('react-clickaway')
]
```And then just add the method:
```js
componentClickAway: function() {
console.log('Someone clicked outside this component...')
}
```## Thanks
This is just a modularized version of the https://github.com/callemall work, they used this script internally on material-ui.