-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Display destructured props from separate files #548
Comments
Curious why you don't export the Icon proptypes from the same file? Not sure if it would solve your issue, but might be worth a try? |
I guess it's a habit where we only have one export per file like this. That being said I'm not sure it would solve it anyway but I'd rather not export multiple items out of a component file. |
Give a look at our project https://github.com/alfa-laboratory/arui-feather/blob/master/src/email-input/email-input.jsx#L20 |
Looks like this is a known issue in react-docgen: reactjs/react-docgen#33 Closing this and following there. |
In my UI component library I export components but I also export some PropTypes. Here is an example:
IconPropTypes.js
This gets used in my Icon component.
Icon.jsx
I export this because I can extend the icon set on a per project basis by using the same IconPropTypes (but really the explanation here is not important). The output in react-styleguidist only shows the
role
andsize
props with their default values, presumably ignoring my propTypes because they are set to an external source.It would be nice if somehow, in a case like this, styleguidist could crawl that file and report the PropTypes that live within it. I think this is a relatively common use case, or maybe I'm mistaken, but it's pretty common in our UI kit so that we're not re-writing the same PropTypes for components that get extended on a per project basis.
Thoughts?
The text was updated successfully, but these errors were encountered: