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

Info addon doesn't renders component description #4643

Closed
MihaChicken opened this issue Oct 30, 2018 · 5 comments
Closed

Info addon doesn't renders component description #4643

MihaChicken opened this issue Oct 30, 2018 · 5 comments

Comments

@MihaChicken
Copy link

Bug or support request summary

I'm using Storybook with info-addon to auto create documentation based on Flow specification and jsdoc comments. The problem is that props table is displayed correctly but there is no component description. After debuging I found out that the problem is actually in this line:
https://github.com/storybooks/storybook/blob/master/addons/info/src/components/Story.js#L253

if (STORYBOOK_REACT_CLASSES[key].name === context.story) {
     retDiv = <div>{STORYBOOK_REACT_CLASSES[key].docgenInfo.description}</div>;
}

This condition in if statement is never truthful because left side is a component name but right side is a story description (like 'bold centered text with no margins').
Changing the condition to: if (STORYBOOK_REACT_CLASSES[key].name === context.kind) { solves all the problems.

Could anyone please tell me is it a bug or am I doing something wrong?

  • @storybook/react 4.0.0
  • @storybook/addon-info 4.0.0
@stale
Copy link

stale bot commented Nov 20, 2018

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Nov 20, 2018
@stale stale bot removed the inactive label Nov 24, 2018
@shilman shilman added the bug label Nov 24, 2018
@shilman
Copy link
Member

shilman commented Nov 24, 2018

This certainly looks like a bug. @danielduan mind taking a quick look? @MihaChicken any chance you could put together a PR for this?

@MihaChicken
Copy link
Author

@shilman Already done :)
#4685

@shilman
Copy link
Member

shilman commented Nov 25, 2018

@MihaChicken dang guys, you're 5 steps ahead. 😲 Will get that out soon. Thanks for making it happen! 🙇

shilman added a commit that referenced this issue Nov 25, 2018
…iption

GH-4643 fix docgen description displaying for info addon
shilman added a commit that referenced this issue Nov 25, 2018
…iption

GH-4643 fix docgen description displaying for info addon
@shilman shilman added the merged label Nov 25, 2018
@shilman
Copy link
Member

shilman commented Nov 25, 2018

This just went out in https://github.com/storybooks/storybook/releases/tag/v4.0.9, closing!

Great work @MihaChicken 🎉

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