react-onclick-outside
v0.1.0
Published
On click outside the component decorator
Downloads
8
Readme
React onclick outside
On click outside the component decorator
Installation
npm install --save react-onclick-decorator
Example
import React from 'react'
import {connect} from 'react-redux'
import multidecorator from 'react-multidecorator'
import onClickOutside from 'react-onclick-outside'
import {bindActionCreators} from 'redux'
import {close} from './actions'
const Popup = (...)
export default multidectorator(
connect(undefined, ( dispatch )=>({
close: bindActionCreators( close, dispatch )
}),
onClickOutside( props => props.close() )
)(Popup)