File tree Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ const React = require('react');
55const ReactDOM = require ( 'react-dom' ) ;
66
77function enhanceWithClickOutside ( Component : React . ComponentType < * > ) {
8- const componentName = Component . displayName || Component . name ;
8+ const componentName =
9+ Component . displayName || Component . name || 'WrappedComponent' ;
910
1011 class EnhancedComponent extends React . Component < * > {
1112 __domNode : * ;
@@ -27,12 +28,13 @@ function enhanceWithClickOutside(Component: React.ComponentType<*>) {
2728
2829 handleClickOutside ( e ) {
2930 const domNode = this . __domNode ;
31+ const wrappedInstance : any = this . __wrappedInstance ;
3032 if (
3133 ( ! domNode || ! domNode . contains ( e . target ) ) &&
32- this . __wrappedInstance &&
33- typeof this . __wrappedInstance . handleClickOutside === 'function'
34+ wrappedInstance &&
35+ typeof wrappedInstance . handleClickOutside === 'function'
3436 ) {
35- this . __wrappedInstance . handleClickOutside ( e ) ;
37+ wrappedInstance . handleClickOutside ( e ) ;
3638 }
3739 }
3840
Original file line number Diff line number Diff line change 4141 "enzyme-adapter-react-16" : " 1.0.0" ,
4242 "eslint" : " 4.8.0" ,
4343 "eslint-config-kentor" : " 5.1.0" ,
44- "flow-bin" : " 0.65.0 " ,
44+ "flow-bin" : " ^0.98.1 " ,
4545 "jest" : " 21.2.1" ,
4646 "react" : " 16.0.0" ,
4747 "react-dom" : " 16.0.0" ,
Original file line number Diff line number Diff line change @@ -2370,9 +2370,10 @@ flat-cache@^1.2.1:
23702370 graceful-fs "^4.1.2"
23712371 write "^0.2.1"
23722372
2373- flow-bin@0.65.0 :
2374- version "0.65.0"
2375- resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.65.0.tgz#64ffeca27211c786e2d68508c65686ba1b8a2169"
2373+ flow-bin@^0.98.1 :
2374+ version "0.98.1"
2375+ resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.98.1.tgz#a8d781621c91703df69928acc83c9777e2fcbb49"
2376+ integrity sha512-y1YzQgbFUX4EG6h2EO8PhyJeS0VxNgER8XsTwU8IXw4KozfneSmGVgw8y3TwAOza7rVhTlHEoli1xNuNW1rhPw==
23762377
23772378for-in@^1.0.1 :
23782379 version "1.0.2"
You can’t perform that action at this time.
0 commit comments