Skip to content

Commit fe7fc0a

Browse files
authored
Update command to create a new project
- The react-scripts-ts package is deprecated. The new option is "--template typescript".
1 parent 2441f01 commit fe7fc0a

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

zh/tutorials/react.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,12 @@
1111

1212
这里假设你已经在使用[Node.js](https://nodejs.org/)[npm](https://www.npmjs.com/)。 并且已经了解了[React的基础知识](https://reactjs.org/docs/hello-world.html)
1313

14-
## 安装create-react-app
15-
16-
我们之所以使用create-react-app是因为它能够为React工程设置一些有效的工具和权威的默认参数。 它仅仅是一个用来搭建React工程的命令行工具而已。
17-
18-
```text
19-
npm install -g create-react-app
20-
```
21-
2214
## 创建新工程
2315

2416
让我们首先创建一个叫做`my-app`的新工程:
2517

2618
```text
27-
create-react-app my-app --scripts-version=react-scripts-ts
19+
npx create-react-app my-app --template typescript
2820
```
2921

3022
[react-scripts-ts](https://www.npmjs.com/package/react-scripts-ts)是一系列适配器,它利用标准的create-react-app工程管道并把TypeScript混入进来。

0 commit comments

Comments
 (0)