File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed
@plotly/dash-generator-test-component-typescript/src Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- import { WrappedHTMLProps } from '../props' ;
2
+ import { WrappedHTMLProps } from '../props' ;
3
3
4
4
/**
5
5
* Component docstring
Original file line number Diff line number Diff line change @@ -17,5 +17,5 @@ export {
17
17
FCComponent ,
18
18
EmptyComponent ,
19
19
MixedComponent ,
20
- RequiredChildrenComponent ,
20
+ RequiredChildrenComponent
21
21
} ;
Original file line number Diff line number Diff line change @@ -734,14 +734,14 @@ function gatherComponents(sources, components = {}) {
734
734
return null
735
735
}
736
736
737
- // if (isArrowFunction) {
738
- // const signature = checker.getSignaturesOfType(type, ts.SignatureKind.Call)[0];
739
- // const returnType = checker.typeToString(signature.getReturnType());
740
- // if (returnType !== 'Element') {
741
- // // Not JSX so no need to classifiy as compnent
742
- // return null;
743
- // }
744
- // }
737
+ if ( isArrowFunction ) {
738
+ const signature = checker . getSignaturesOfType ( type , ts . SignatureKind . Call ) [ 0 ] ;
739
+ const returnType = checker . typeToString ( signature . getReturnType ( ) ) ;
740
+ if ( ! [ 'Element' , 'any' , 'null' ] . includes ( returnType ) ) {
741
+ // Not JSX so no need to classifiy as compnent
742
+ return null ;
743
+ }
744
+ }
745
745
746
746
let defaultProps = getDefaultProps ( typeSymbol , source ) ;
747
747
const propsType = getPropsForFunctionalComponent ( type ) ;
You can’t perform that action at this time.
0 commit comments