Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong composes for propType objects that are wrapped #283

Open
argshook opened this issue Jul 16, 2018 · 0 comments
Open

wrong composes for propType objects that are wrapped #283

argshook opened this issue Jul 16, 2018 · 0 comments

Comments

@argshook
Copy link

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 #248 was closed, so perhaps this issue should be considered too.

Thanks for the library!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant