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

fix info not importing docgen descriptions #2133

Merged
merged 5 commits into from
Oct 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions addons/info/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { withInfo } from '@storybook/addon-info';

storiesOf('Component', module)
.add('simple info',
withInfo('doc string about my component')(() =>
withInfo('description or documentation about my component, supports markdown')(() =>
<Component>Click the "?" mark at top-right to view the info.</Component>
)
)
Expand Down Expand Up @@ -148,7 +148,7 @@ setAddon(infoAddon);
### React Docgen Integration

React Docgen is included as part of the @storybook/react package through the use of `babel-plugin-react-docgen` during babel compile time.
When rendering a story with a React component commented in this supported format, the Addon Info prop table will display the prop's comment in the description column.
When rendering a story with a React component commented in this supported format, the Addon Info description will render the comments above the component declaration and the prop table will display the prop's comment in the description column.

```js
import React from 'react';
Expand Down
2 changes: 1 addition & 1 deletion addons/info/src/components/Story.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export default class Story extends React.Component {

if (Object.keys(STORYBOOK_REACT_CLASSES).length) {
Object.keys(STORYBOOK_REACT_CLASSES).forEach(key => {
if (STORYBOOK_REACT_CLASSES[key].name === this.props.context.kind) {
if (STORYBOOK_REACT_CLASSES[key].name === this.props.context.story) {
retDiv = <div>{STORYBOOK_REACT_CLASSES[key].docgenInfo.description}</div>;
}
});
Expand Down