Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e7c8366

Browse filesBrowse files
wdhortongaearon
authored andcommitted
Use most recent React version (facebook#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
Copy full SHA for e7c8366

File tree

Expand file treeCollapse file tree

1 file changed

+3
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-4
lines changed

‎scripts/init.js

Copy file name to clipboardExpand all lines: scripts/init.js
+3-4Lines changed: 3 additions & 4 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.