From 928ea5e1c1f5c2248a1296108729e2555c6003f6 Mon Sep 17 00:00:00 2001 From: Tom Coleman Date: Fri, 23 Jun 2017 14:07:16 +1000 Subject: [PATCH] Ensure we add the correct version of `react-dom` We need to use an equal version to the `react` version the app is using. #1284 --- lib/cli/generators/REACT_NATIVE/index.js | 3 ++- lib/cli/generators/REACT_NATIVE_SCRIPTS/index.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/cli/generators/REACT_NATIVE/index.js b/lib/cli/generators/REACT_NATIVE/index.js index f0318e212508..e60007786675 100644 --- a/lib/cli/generators/REACT_NATIVE/index.js +++ b/lib/cli/generators/REACT_NATIVE/index.js @@ -31,7 +31,8 @@ module.exports = latestVersion('@storybook/react-native').then(version => { packageJson.devDependencies['@storybook/react-native'] = `^${version}`; if (!packageJson.dependencies['react-dom'] && !packageJson.devDependencies['react-dom']) { - packageJson.devDependencies['react-dom'] = '^15.5.4'; + const reactVersion = packageJson.dependencies.react; + packageJson.devDependencies['react-dom'] = reactVersion; } packageJson.scripts = packageJson.scripts || {}; diff --git a/lib/cli/generators/REACT_NATIVE_SCRIPTS/index.js b/lib/cli/generators/REACT_NATIVE_SCRIPTS/index.js index fe05fbdbf474..b163469d2082 100644 --- a/lib/cli/generators/REACT_NATIVE_SCRIPTS/index.js +++ b/lib/cli/generators/REACT_NATIVE_SCRIPTS/index.js @@ -15,7 +15,8 @@ module.exports = latestVersion('@storybook/react-native').then(version => { packageJson.devDependencies['@storybook/react-native'] = `^${version}`; if (!packageJson.dependencies['react-dom'] && !packageJson.devDependencies['react-dom']) { - packageJson.devDependencies['react-dom'] = '^15.5.4'; + const reactVersion = packageJson.dependencies.react; + packageJson.devDependencies['react-dom'] = reactVersion; } packageJson.scripts = packageJson.scripts || {};