We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4de2733 commit e330839Copy full SHA for e330839
src/components/OutsideClickHandler.jsx
@@ -38,9 +38,11 @@ export default class OutsideClickHandler extends React.Component {
38
}
39
40
onOutsideClick(e) {
41
- const isDescendantOfRoot = this.childNode.contains(e.target);
+ const { onOutsideClick } = this.props;
42
+ const { childNode } = this;
43
+ const isDescendantOfRoot = childNode && childNode.contains(e.target);
44
if (!isDescendantOfRoot) {
- this.props.onOutsideClick(e);
45
+ onOutsideClick(e);
46
47
48
0 commit comments