{"repo":"Pomax/react-onclickoutside","free":true,"listed":false,"github":"https://github.com/Pomax/react-onclickoutside","clone":"git clone https://github.com/Pomax/react-onclickoutside.git","description":"An onClickOutside wrapper for React components","language":"JavaScript","stars":1816,"topics":["javascript","react","onclick","outsideclick","hoc"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":":warning: Open source is free, but developer time isn't :warning: This package needs your support to stay maintained. If you work for an organization whose website is better off using react-onclickoutside than rolling its own code solution, please consider talking to your manager to help fund this project. Open Source is free to use, but certainly not free to develop. If you have the means to reward those whose work you rely on, please consider doing so. An onClickOutside wrapper for React components This is a React Higher Order Component (HOC) that you can use with your own React components if you want to have them listen for clicks that occur somewhere in the document, outside of the element itself (for instance, if you need to hide a menu when people click anywhere else on your page). Note that this HOC relies on the .classList property, which is supported by all modern browsers, but not by deprecated and obsolete browsers like IE (noting that Microsoft Edge is not Microsoft Internet Explorer. Edge does not have any problems with the classList property for SVG elements). If your code relies on classList in any way, you want to use a polyfill like dom4. This HOC supports stateless components as of v5.7.0, and switched to using transpiled es6 classes rather than createClass as of v6. Sections covered in this README Installation Usage: Functional Component with UseState Hook ES6 Class Component CommonJS Require Ensuring there's a click handler Regulate which events to listen ","default_branch":null,"files":null,"tree":[],"storefront":"/r/Pomax","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Pomax/react-onclickoutside/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}