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

[addon-docs] Documentation is missing if component is exported with a higher order component (like React.memo) #8846

Closed
laplacesdemon opened this issue Nov 15, 2019 · 1 comment

Comments

@laplacesdemon
Copy link

Describe the bug
When exporting a component like the following, the docs from comments are embedded in the "docs" page:

export default MyComponent

But it's not the case if it's exported like this:

export default React.memo(MyComponent);

// or any other HOC:
// export default pipe(withErrorBoundary, withMemo)(MyComponent)

I've tested it in the new story style:

import MyComponent from '..';

export default {
title: 'MyComponent',
component: MyComponent
}

export const MyStory = ...

Expected behavior
The docs should be embedded in the docs page:
Screen Shot 2019-11-15 at 11 01 47 AM

Current Behavior
The docs and props are not embedded, only the stories are visible.
Screen Shot 2019-11-15 at 10 58 43 AM

@shilman
Copy link
Member

shilman commented Nov 15, 2019

closing as dupe to #8361

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants