Skip to content

Commit e7c8366

Browse files
wdhortongaearon
authored andcommitted
Use most recent React version (#477)
* Get latest version numbers of react and react-dom from npm before install. * Run separate npm installs for react, react-dom, and react-test-renderer. * Consolidate into a single npm install. * Fix misplaced parenthesis, add missing semicolon. * Add missing semicolon.
1 parent 9e81d1c commit e7c8366

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Diff for: scripts/init.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,9 @@ module.exports = function(appPath, appName, verbose, originalDirectory) {
1515
var ownPath = path.join(appPath, 'node_modules', 'react-scripts');
1616

1717
var appPackage = require(path.join(appPath, 'package.json'));
18-
var ownPackage = require(path.join(ownPath, 'package.json'));
1918

2019
// Copy over some of the devDependencies
2120
appPackage.dependencies = appPackage.dependencies || {};
22-
['react', 'react-dom'].forEach(function (key) {
23-
appPackage.dependencies[key] = ownPackage.devDependencies[key];
24-
});
2521

2622
// Setup the script rules
2723
appPackage.scripts = {};
@@ -52,6 +48,9 @@ module.exports = function(appPath, appName, verbose, originalDirectory) {
5248
// TODO: having to do two npm installs is bad, can we avoid it?
5349
var args = [
5450
'install',
51+
'react',
52+
'react-dom',
53+
'--save',
5554
verbose && '--verbose'
5655
].filter(function(e) { return e; });
5756
var proc = spawn('npm', args, {stdio: 'inherit'});

0 commit comments

Comments
 (0)