-
Notifications
You must be signed in to change notification settings - Fork 28
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
Support multiple exports #57
Comments
Hey Sam! Thanks for raising this issue! It's a good idea, with some design constraints/history worth knowing about before diving in to it. We actually used to do this (on the Basically it found everything in your file that was a We switched this when we switched to also analysing functional components, which switched us to analysing export instead of just found components. By only looking at default, we can make an assumption that the export is a component (functional or otherwise), and analyse them like that. In fact, our logic to detect a functional component is just extract-react-types/packages/extract-react-types/src/index.js Lines 1567 to 1575 in a972d10
:badpokerface: Analysing multiple exports and being confident they are all components probably means implementing real logic here that determines whether a function is a function component or not. (Though we want to do that anyway, as Uh, hope that helps answer your question! The easy answer is yes, qualified by the above. |
ps. If you want to just use multiple exports now, you can via this exported function that we have failed to document: extract-react-types/packages/extract-react-types/src/index.js Lines 1603 to 1614 in a972d10
|
Hi there,
I was just wondering if you'd consider supporting files that export multiple components?
I noticed in here that you just take the first component: https://github.com/atlassian/extract-react-types/blob/master/packages/extract-react-types/src/index.js#L132
I'm happy to submit a PR for this, just wanted to see if that would be something you'd be open to supporting?
Thanks
The text was updated successfully, but these errors were encountered: