From 914f7e1dffe25474e54263a20ae0c991fe90f6bb Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Fri, 28 Sep 2018 10:40:34 -0400 Subject: [PATCH] Cleanup README --- template/README.md | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/template/README.md b/template/README.md index 76b27af7e36..fb7a8bed74b 100644 --- a/template/README.md +++ b/template/README.md @@ -118,7 +118,7 @@ When you run `create-react-app`, it always creates the project with the latest v To update an existing project to a new version of `react-scripts`, [open the changelog](https://github.com/facebook/create-react-app/blob/master/CHANGELOG.md), find the version you’re currently on (check `package.json` in this folder if you’re not sure), and apply the migration instructions for the newer versions. -In most cases bumping the `react-scripts` version in `package.json` and running `npm install` in this folder should be enough, but it’s good to consult the [changelog](https://github.com/facebook/create-react-app/blob/master/CHANGELOG.md) for potential breaking changes. +In most cases bumping the `react-scripts` version in `package.json` and running `npm install` (or `yarn install`) in this folder should be enough, but it’s good to consult the [changelog](https://github.com/facebook/create-react-app/blob/master/CHANGELOG.md) for potential breaking changes. We commit to keeping the breaking changes minimal so you can upgrade `react-scripts` painlessly. @@ -366,20 +366,20 @@ If you use a custom server for your app in production and want to modify the tit The generated project includes React and ReactDOM as dependencies. It also includes a set of scripts used by Create React App as a development dependency. You may install other dependencies (for example, React Router) with `npm`: ```sh -npm install --save react-router +npm install --save react-router-dom ``` Alternatively you may use `yarn`: ```sh -yarn add react-router +yarn add react-router-dom ``` -This works for any library, not just `react-router`. +This works for any library, not just `react-router-dom`. ## Importing a Component -This project setup supports ES6 modules thanks to Babel.
+This project setup supports ES6 modules thanks to Webpack.
While you can still use `require()` and `module.exports`, we encourage you to use [`import` and `export`](http://exploringjs.com/es6/ch_modules.html) instead. For example: @@ -513,9 +513,11 @@ If you are concerned about using Webpack-specific semantics, you can put all you ## Adding a CSS Modules stylesheet +> Note: this feature is available with `react-scripts@2.0.0` and higher. + This project supports [CSS Modules](https://github.com/css-modules/css-modules) alongside regular stylesheets using the **[name].module.css** file naming convention. CSS Modules allows the scoping of CSS by automatically creating a unique classname of the format **[filename]\_[classname]\_\_[hash]**. -> **Tip:** Should you want to preprocess a stylesheet with Sass then make sure to [follow the installation instructions](#adding-a-sass-stylesheet) and then change the stylesheet file extension as follows: *[name].module.scss* or *[name].module.sass*. +> **Tip:** Should you want to preprocess a stylesheet with Sass then make sure to [follow the installation instructions](#adding-a-sass-stylesheet) and then change the stylesheet file extension as follows: _[name].module.scss_ or _[name].module.sass_. An advantage of this is the ability to repeat the same classname within many CSS files without worrying about a clash. @@ -563,6 +565,8 @@ No clashes from other `.error` class names ## Adding a Sass stylesheet +> Note: this feature is available with `react-scripts@2.0.0` and higher. + Generally, we recommend that you don’t reuse the same CSS classes across different components. For example, instead of using a `.Button` CSS class in `` and `` components, we recommend creating a `