React On Click Outside HOC
JSON →react-onclickoutside is a Higher Order Component (HOC) for React class components, currently at version 6.13.2. It enables wrapped components to detect and respond to click events that occur anywhere in the document outside their own DOM element, commonly used for dismissing menus, modals, or dropdowns. While it supports React versions 15.5.x through 18.x, the library's documentation explicitly recommends against its use with modern React functional components and hooks, suggesting manual implementation of `useRef` and `useEffect` instead. The project indicates it requires community support for continued maintenance. It relies on the `.classList` property, necessitating a polyfill like `dom4` for compatibility with older browsers like Internet Explorer. Releases are irregular, with the last major refactor to ES6 classes occurring in v6.
Traffic · last 30 days ↓14% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇩🇪 Germany · 🇫🇷 France