storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
84.2k stars 9.26k forks source link

Automigration: React #18314

Open shilman opened 2 years ago

shilman commented 2 years ago

To address `can't resolve 'react/package.json' issues, add the following automigration:

  1. Try to resolve react and react-dom
  2. If the resolution fails, offer to install for the user:

We noticed that you don't have react or react-dom installed. Due to changes in modern package managers (e.g. npm8) we now recommend that you install these as dev dependencies in your project.

Example issues: https://github.com/storybookjs/storybook/issues/17448 https://github.com/storybookjs/storybook/issues/18266

GrumpyMeow commented 2 years ago

Hi, I'm working on a NX-workspace with only Angular-projects. Having to install dependencies React packages is confusing. Is there really no other solution?

On my workspace the issue did got resolved with running:

npm i -D react@17.0.2 react-dom@17.0.2