react-clickoutside-component
A high-order Component wrapper to provide click outside functionality to the wrapped components
Demo
How to use
- Import
ClickOutside
component - Wrap your main component with the
ClickOutside
- Provide an
onClickOutside
callback.
Example
;;; Component { super; thisstate = text: 'Click Somewhere' } this this { return <ClickOutside onClickOutside= this > <div onClick= this id="demo" > thisstatetext </div> </ClickOutside>; } ReactDOM;
Options:
Name | Description |
---|---|
onClickOutside | function that is called when a click happened outside of the component |
Changelog:
24-02-2016 Release version 1.0.4
- Move React depedency to peerDepedencies
24-02-2016 Release version 1.0.3
- First release
Contribute
Any pull-request is more than welcome 💥 😄
License
MIT