From 5e9478f4f616c870cdf49e4d5b5df15174de47ff Mon Sep 17 00:00:00 2001 From: Matt Oakes Date: Tue, 23 May 2017 09:22:08 +0100 Subject: [PATCH] Add react-dom to the devDependency list for React Native projects --- lib/cli/generators/REACT_NATIVE/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/cli/generators/REACT_NATIVE/index.js b/lib/cli/generators/REACT_NATIVE/index.js index a5c263bc7455..0b0dd6410153 100644 --- a/lib/cli/generators/REACT_NATIVE/index.js +++ b/lib/cli/generators/REACT_NATIVE/index.js @@ -19,9 +19,15 @@ module.exports = latestVersion('@storybook/react-native').then(version => { const packageJson = helpers.getPackageJson(); + packageJson.dependencies = packageJson.dependencies || {}; packageJson.devDependencies = packageJson.devDependencies || {}; + packageJson.devDependencies['@storybook/react-native'] = `^${version}`; + if (!packageJson.dependencies['react-dom'] && !packageJson.devDependencies['react-dom']) { + packageJson.devDependencies['react-dom'] = '^15.5.4'; + } + packageJson.scripts = packageJson.scripts || {}; packageJson.scripts['storybook'] = 'storybook start -p 7007';