Skip to content

Commit

Permalink
Add react-scripts automatic setup to docs (#9182)
Browse files Browse the repository at this point in the history
Add react-scripts automatic setup to docs
  • Loading branch information
shilman committed Jan 11, 2020
1 parent dad2ccc commit 043257d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion docs/src/pages/guides/guide-react/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,26 @@ title: 'Storybook for React'

## Automatic setup

Before trying the below commands, you should try the following command. In most cases, Storybook will detect that you're using `react` or `react-scripts`, and install the appropriate packages.

```sh
npx -p @storybook/cli sb init
```

You may have tried to use our quick start guide to setup your project for Storybook.
If it failed because it couldn't detect you're using React, you could try forcing it to use React:

```sh
npx -p @storybook/cli sb init --type react
```

Note: be sure you have a `package.json` in your project or the above command will fail.
If you're using [Create React App](https://create-react-app.dev/) (or a fork of `react-scrips`), you should use this command instead:

```sh
npx -p @storybook/cli sb init --type react_scripts
```

Note: You must have a `package.json` in your project or the above commands will fail.

If you're using [Create React App](https://create-react-app.dev/), use:

Expand Down

0 comments on commit 043257d

Please sign in to comment.