Is there any way to get react-docgen to traverse imports? See for example React Native Text.js
importtype{PressRetentionOffset,TextProps}from'./TextProps';then
constText=(props: TextProps,forwardedRef: ?React.Ref<'RCTText'|'RCTVirtualText'>,)=>{return<TouchableText{...props}forwardedRef={forwardedRef}/>;};constTextToExport=React.forwardRef(Text);TextToExport.displayName='Text';// TODO: Deprecate this./* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an error * found when Flow v0.89 was deployed. To see the error, delete this comment * and run Flow. */TextToExport.propTypes=DeprecatedTextPropTypes;typeTextStatics=$ReadOnly<{|propTypes: typeofDeprecatedTextPropTypes,|}>;module.exports=((TextToExport: any): React.AbstractComponent<TextProps,React.ElementRef<HostComponent<TextProps>>,>&TextStatics);generates
"Libraries\\Text\\Text.js": {
"description": "",
"displayName": "Text",
"methods": [],
"composes": [
"../DeprecatedPropTypes/DeprecatedTextPropTypes"
]
},
Meaning, react-docgen doesn't see the definition of TextProps in a separate file. If I replace the import with the definition then everything works as expected.
Is there any way to get react-docgen to traverse imports? See for example React Native Text.js
then
generates
Meaning, react-docgen doesn't see the definition of TextProps in a separate file. If I replace the import with the definition then everything works as expected.