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) {
2020 if ( argument . node . type === 'JSXElement' ) {
2121 visited = true ;
2222 } 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+
2329 const name = argument . get ( 'callee' ) . node . name ;
2430 const binding = path . scope . getBinding ( name ) ;
2531
Original file line number Diff line number Diff line change @@ -91,3 +91,11 @@ function Foo8() {
9191Foo8 . propTypes = {
9292 foo : React . PropTypes . string
9393} ;
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() {
6161 } ;
6262 return obj . deep . member ( ) ;
6363}
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