react-click-outside
react-click-outside copied to clipboard
Introduce useClickOutside hook
Related to #46
lgtm
Tough, when I test your pr with typescript, then I see that this looks suspicious
enhanceWithClickOutside.useClickOutside = useClickOutside;
module.exports = enhanceWithClickOutside;
writing a key of a function doesn't seem to work. Shouldn't it be an object? Otherwise supporting es6 export/import operators would make more sense when looking to export more than 1 function from a file.
Also this function seems to get complaints from typescript when I copy it over (can still probably be ignored since this isn't typescript)
Object is possibly 'null'. TS2531
16 | () => {
17 | const onClick = (e: Event) => {
> 18 | if ((!domNode || !domNode.contains(e.target)) && onClickOutside)
| ^
19 | onClickOutside(e);
20 | };
21 |
Hi folks, What is the current status ? It would be extremely handy.