react-outer
React component for handling outside clicks. Inspired by reactstrap.
Installation
yarn add react-outer
Api
Properties
OuterpropTypes = tag: PropTypes isOpen: PropTypesbool // default true children: PropTypesnode onClickOutside: PropTypesfuncisRequired;
Example
;; { superprops; thishandleOutsideClick = thishandleOutsideClick; } { // ... } { return <Outside tag="ul" className="dropdown-menu" onClickOutside=thishandleOutsideClick > <li>Items</li> </Outside> ; }
License
MIT