Skip to content

Repo to demonstrate Storybook installation with CRA 5 & React 18 without preset-create-react-app

Notifications You must be signed in to change notification settings

nareshbhatia/cra-with-storybook-without-preset

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CRA with Storybook without preset

This project was bootstrapped with Create React App.

How Storybook was initialized

To list available options, start sb init with the --help option:

npx sb init --help

Usage: sb init [options]

Initialize Storybook into your project.

Options:
  -f --force                                       Force add Storybook
  -s --skip-install                                Skip installing deps
  -N --use-npm                                     Use npm to install deps
  -p --parser <babel | babylon | flow | ts | tsx>  jscodeshift parser
  -t --type <type>                                 Add Storybook for a specific project type
  -y --yes                                         Answer yes to all prompts
  -b --builder <builder>                           Builder library
  -l --linkable                                    Prepare installation for link (contributor helper)
  -h, --help                                       display help for command

Storybook was added using sb init with the following options. This prevents sb init from automatically detecting the application type (in this case CRA). We explicitly ask for application type react and the webpack5 builder.

npx sb init --skip-install --type react --builder webpack5

After this I had to add the following overrides to package.json to overcome dependency conflicts:

{
  "overrides": {
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-refresh": "0.13.0"
  }
}

Running Storybook

npm run storybook

Running the app

npm start

About

Repo to demonstrate Storybook installation with CRA 5 & React 18 without preset-create-react-app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published