diff --git a/index.js b/index.js index 725208f..5274bbf 100644 --- a/index.js +++ b/index.js @@ -3,11 +3,16 @@ import React, { Component, PropTypes } from 'react' export default class ClickOutside extends Component { static propTypes = { - onClickOutside: PropTypes.func.isRequired + onClickOutside: PropTypes.func.isRequired, + shouldClickOutside: PropTypes.func + }; + + static defaultProps = { + shouldClickOutside: () => true }; render() { - const { children, onClickOutside, ...props } = this.props + const { children, onClickOutside, shouldClickOutside, ...props } = this.props return