-
-
Notifications
You must be signed in to change notification settings - Fork 311
Add resolver "findAllExportedComponentDefinitions" #114
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
Add resolver "findAllExportedComponentDefinitions" #114
Conversation
ac76a11 to
464d466
Compare
|
This is great, thank you! I was just thinking about this the other day. |
|
Ah, great. Glad to see things go into upstream :) |
That's perfect. I will actually post something very soon about how I see react-docgen moving forward, and that's exactly what I had in mind! |
|
Could you export this handler from |
464d466 to
2ecc54d
Compare
| export default function findExportedComponentDefinitions( | ||
| ast: ASTNode, | ||
| recast: Object | ||
| ): ?NodePath { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like you need to change this type annotation to Array<NodePath>.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried changing it yesterday and got different errors. I'll look into it when I have a bit more time.
2ecc54d to
ccb412e
Compare
This resolver is basically a copy of the "findExportedComponentDefinition" resolver inclusive the tests. The most significant difference is, that this resolver does not throw when it encounters more than one component definition. It adds all found component definitions into an array (deduplicated) and returns that array at the end of execution.
ccb412e to
9355af5
Compare
This resolver is basically a direct copy of the
"findExportedComponentDefinition" resolver including the tests.
The most significant difference is, that this resolver does not throw
when it encounters more than one component definition.
It adds all found component definitions into an array (deduplicated)
and returns that array at the end of execution.