-
Notifications
You must be signed in to change notification settings - Fork 88
Conversation
eded4ad
to
eb8d1bf
Compare
if (!node.arguments) { | ||
// likely stateless function component. Check if assigned to a variable |
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.
threading the parent
node through to here so that the following example resolves a displayName of MyComponent
const MyComponent = (props) => <div />
eb8d1bf
to
c0e0313
Compare
}, | ||
_$factory: { | ||
displayName: "factory", | ||
isInFunction: true |
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’m not certain if all of these are actually correct; I suspect not, though.
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.
e.g.
const MyComp = (props) => <div />;
probably should not be marked as isInFunction
, correct?
Oh shucks, I just saw #34 and the reference to react-proxy@react-0.14. Whoops :) |
@iamdustan if you have time, would love some review on some of the changes I made! Have just been doing what I can to make the test cases pass or generate new ones for edge cases. |
:) @joshblack I’ve just been adding support for these things to another project. reactjs/react-docgen#28. Divide and conquer! |
I’m kind of biased towards not supporting edge cases and guiding folks down the preferred path. |
Detect and wrap stateless function components.