File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed
test/fixtures/stateless-functional-components Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,12 @@ function isReturningJSXElement(path) {
20
20
if ( argument . node . type === 'JSXElement' ) {
21
21
visited = true ;
22
22
} else if ( argument . node . type === 'CallExpression' ) {
23
+
24
+ const node = argument . get ( 'callee' ) . node ;
25
+ if ( node . object . name === 'React' && node . property . name === 'createElement' ) {
26
+ visited = true ;
27
+ }
28
+
23
29
const name = argument . get ( 'callee' ) . node . name ;
24
30
const binding = path . scope . getBinding ( name ) ;
25
31
Original file line number Diff line number Diff line change @@ -91,3 +91,11 @@ function Foo8() {
91
91
Foo8 . propTypes = {
92
92
foo : React . PropTypes . string
93
93
} ;
94
+
95
+ const Foo9 = ( ) => {
96
+ return React . createElement ( "div" , null ) ;
97
+ } ;
98
+
99
+ Foo9 . propTypes = {
100
+ foo : React . PropTypes . string
101
+ } ;
Original file line number Diff line number Diff line change @@ -61,3 +61,7 @@ function Foo8() {
61
61
} ;
62
62
return obj . deep . member ( ) ;
63
63
}
64
+
65
+ var Foo9 = function Foo9 ( ) {
66
+ return React . createElement ( "div" , null ) ;
67
+ } ;
You can’t perform that action at this time.
0 commit comments