-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
84dfd4f
commit a32abfd
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { logger } from '@storybook/node-logger'; | ||
import dedent from 'ts-dedent'; | ||
|
||
export function ensureReactPeerDeps() { | ||
try { | ||
require.resolve('react'); | ||
require.resolve('react-dom'); | ||
} catch (e) { | ||
logger.error(dedent` | ||
Starting in 7.0, react and react-dom are now required peer dependencies of Storybook. | ||
Please install react and react-dom in your project. | ||
npm: | ||
$ npm add react react-dom --dev | ||
yarn: | ||
$ yarn add react react-dom --dev | ||
pnpm: | ||
$ pnpm add react react-dom --dev | ||
`); | ||
process.exit(1); | ||
} | ||
} |