You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 20, 2020. It is now read-only.
Note: This may be an inherited limitation of react-docgen-typescript.
Consider a project with the following files:
// MyComponent.tsximport{CommonProps}from'./common';exporttypeMyComponentProps=CommonProps&{/** Description for myProp */myProps?: string};exportconstMyComponent=(props: MyComponentProps)=>null;
// common.tsexporttypeCommonProps={/** Description for common prop */common?: string};
Naively, one would expect the common prop to be properly documented on MyComponent and whilst the common prop does appear the docgen description is NOT included.
However, it is possible to coax the loader into the expected behaviour by defining a 'fake' component alongside the CommonProps. e.g.
// common.tsexporttypeCommonProps={/** Description for common prop */common?: string};// WORKAROUND: An otherwise pointless component in order to coax react-docgen-typescript-loaderconstStandardComponent=(props: StandardProps)=>null;
I suspect this will be a limitation of the underlying react-docgen-typescript library but I've not delved deep enough into the issue to know for sure or to know if there is a nice way to fix this.