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

Add support for higher order components with any arbitrary depth. #32

Merged
merged 5 commits into from
Aug 11, 2017
Merged

Conversation

dan-lee
Copy link
Contributor

@dan-lee dan-lee commented Aug 10, 2017

We have the need to support higher-order-components in our docs.
So I added the possibility for the plugin to also provide information about these.

For example this needs to be supported:
export default connect()(withRouter(MyComponent))

It's supported by react-docgen but not by this plugin. With this PR it should also work here :)

Copy link
Member

@danielduan danielduan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR, if we can get these two very minor issues taken care of, I'll get this merged in and published for you.

}

Component.propTypes = {
children: React.PropTypes.string.isRequired,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add some comments in here like /* comment */ like the other files so we can make sure those are extracted properly?

style: React.PropTypes.object,
}

export default withHoc()(deeperHoc(Component))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would you mind adding another test with just 1 hoc? it's a slightly different test case and I don't want this to regress in case someone refactors this.

@dan-lee
Copy link
Contributor Author

dan-lee commented Aug 11, 2017

Thanks for your quick response!
I hope I resolved your issues well, and this can be merged :)

@danielduan danielduan merged commit 63436ab into storybookjs:master Aug 11, 2017
@danielduan
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants