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

update readme for clarity #9731

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions addons/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ Docs has peer dependencies on `react`, `react-is`, and `babel-loader`. If you wa
yarn add -D react react-is babel-loader
```

If using Create React App, enable [this preset](https://github.com/storybookjs/presets/tree/master/packages/preset-create-react-app). Otherwise

```sh
yarn add -D babel-plugin-react-docgen
```

and add `react-docgen` to babelrc.
Copy link
Member

@shilman shilman Feb 3, 2020

Choose a reason for hiding this comment

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

Only if you have a custom babelrc? I believe Storybook's default already includes this, but please let me know if this lines up with what you've seen.

Copy link
Author

Choose a reason for hiding this comment

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

This is beyond my understanding. When I remove my .babelrc, I get syntax errors around my JSX in storybook. I would have assumed without my babelrc storybook would have used a custom config, but would that custom config automatically have preset-react? How can I find that custom config?

I simply followed the config here which I thought will always be necessary with addon-docs?


Then add the following to your `.storybook/main.js`:

```js
Expand Down