File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -21,3 +21,11 @@ export class Button extends React.Component {
21
21
} ;
22
22
}
23
23
}
24
+
25
+ export function foo ( ) {
26
+ return [ ] . join ( ) ;
27
+ }
28
+
29
+ export function chained ( ) {
30
+ return foo . bar ( ) . join ( ) ;
31
+ }
Original file line number Diff line number Diff line change @@ -27,6 +27,15 @@ const validPossibleStatelessComponentTypes = [
27
27
'ArrowFunctionExpression' ,
28
28
] ;
29
29
30
+ function isValidCalleeType ( type ) {
31
+ return [
32
+ 'Identifier' ,
33
+ 'CallExpression' ,
34
+ 'ArrayExpression' ,
35
+ 'Literal'
36
+ ] . indexOf ( type ) < 0 ;
37
+ }
38
+
30
39
function isJSXElementOrReactCreateElement ( path ) {
31
40
return (
32
41
path . node . type === 'JSXElement' ||
@@ -92,7 +101,7 @@ function returnsJSXElementOrReactCreateElementCall(path) {
92
101
resolvedValue = resolveToValue ( calleeValue . get ( 'object' ) ) ;
93
102
}
94
103
else {
95
- while ( calleeValue . get ( 'object' ) . node . type !== 'Identifier' ) {
104
+ while ( isValidCalleeType ( calleeValue . get ( 'object' ) . node . type ) ) {
96
105
calleeValue = calleeValue . get ( 'object' ) ;
97
106
namesToResolve . unshift ( calleeValue . get ( 'property' ) ) ;
98
107
}
You can’t perform that action at this time.
0 commit comments