react-docgen
react-docgen copied to clipboard
wrong `composes` for propType objects that are wrapped
Hello!
when defining prop types people do all sorts of things, for example:
import omit from 'lodash/omit';
import OtherComponent from 'important/path';
export default class Component extends React.PureComponent {
propTypes = {
...omit(OtherComponent.propTypes, ['exclude', 'us']),
something: bool
};
// ...
}
Expected
composes array is ['important/path']
Actual
composes array is ['lodash/omit']
i'm not even sure how this should be handled. In example above it seems that extracting first argument from function should be enough. But what if the composed prop types are not first argument?
Should react-docgen support such cases at all? It seems valid to do so from JS perspective but generated documentation is incomplete.
Recently https://github.com/reactjs/react-docgen/issues/248 was closed, so perhaps this issue should be considered too.
Thanks for the library!