Fix typo in in use-in-typescript.md

This commit is contained in:
Gao Jiangmiao 2018-07-11 01:40:31 +08:00 committed by 陈帅
parent 4b045fc43f
commit 46add091ca
2 changed files with 10 additions and 8 deletions

View File

@ -14,7 +14,8 @@ Ensure your system has installed latest version of [yarn](https://yarnpkg.com) o
Create a new project named `antd-demo-ts` using yarn.
```bash
$ yarn create react-app antd-demo-ts --scripts-version=react-scripts-ts
$ yarn global add create-react-app
$ create-react-app antd-demo-ts --scripts-version=react-scripts-ts
```
If you are using npm (we will use yarn in the following instructions, it's ok to replace yarn with npm)
@ -90,11 +91,11 @@ $ yarn add react-app-rewired --dev
```diff
/* package.json */
"scripts": {
- "start": "react-scripts start",
- "start": "react-scripts-ts start",
+ "start": "react-app-rewired start --scripts-version react-scripts-ts",
- "build": "react-scripts build",
- "build": "react-scripts-ts build",
+ "build": "react-app-rewired build --scripts-version react-scripts-ts",
- "test": "react-scripts test --env=jsdom",
- "test": "react-scripts-ts test --env=jsdom",
+ "test": "react-app-rewired test --env=jsdom --scripts-version react-scripts-ts",
}
```

View File

@ -14,7 +14,8 @@ title: 在 TypeScript 中使用
使用 yarn 创建项目。
```bash
$ yarn create react-app antd-demo-ts --scripts-version=react-scripts-ts
$ yarn global add create-react-app
$ create-react-app antd-demo-ts --scripts-version=react-scripts-ts
```
如果你使用的是 npm接下来我们都会用 yarn 作为例子,如果你习惯用 npm 也没问题)。
@ -89,11 +90,11 @@ $ yarn add react-app-rewired --dev
```diff
/* package.json */
"scripts": {
- "start": "react-scripts start",
- "start": "react-scripts-ts start",
+ "start": "react-app-rewired start --scripts-version react-scripts-ts",
- "build": "react-scripts build",
- "build": "react-scripts-ts build",
+ "build": "react-app-rewired build --scripts-version react-scripts-ts",
- "test": "react-scripts test --env=jsdom",
- "test": "react-scripts-ts test --env=jsdom",
+ "test": "react-app-rewired test --env=jsdom --scripts-version react-scripts-ts",
}
```