3 ms·
A React library called "onclickoutside", https://www.npmjs.com/package/react-onclickoutside https://www.npmjs.com/package/react-onclickoutside, for dealing with
by TheRealPomax 10y ago
A React library called "onclickoutside", https://www.npmjs.com/package/react-onclickoutside https://www.npmjs.com/package/react-onclickoutside, for dealing with clicks from outside a DOM node's tree.
Sounds like a simple thing to have, but when I wrote it it just didn't exist. In half a year it's gone from one guy needing a small lib to deal with closing a menu when you click on the page, to a library with loads of optional functionality, fixes and improvements filed by 24 contributor, and over fifteen thousands downloads a day.
It's probably the most successful piece of software I've written to date.