mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 13:09:40 +08:00
📝 improve create-react-app documentation
https://github.com/facebook/create-react-app/releases/tag/v3.3.0
This commit is contained in:
parent
9b65863512
commit
ab36853cb7
@ -11,10 +11,14 @@ Let's create a TypeScript project by using `create-react-app`, then import `antd
|
||||
|
||||
Ensure your system has installed latest version of [yarn](https://yarnpkg.com) or [npm](https://www.npmjs.com/).
|
||||
|
||||
Create a new project named `antd-demo-ts` using yarn.
|
||||
Create a new [cra-template-typescript](https://github.com/facebook/create-react-app/tree/master/packages/cra-template-typescript) project named `antd-demo-ts` using yarn.
|
||||
|
||||
```bash
|
||||
$ yarn create react-app antd-demo-ts --typescript
|
||||
$ yarn create react-app antd-demo-ts --template typescript
|
||||
|
||||
# or
|
||||
|
||||
npx create-react-app my-app --template typescript
|
||||
```
|
||||
|
||||
If you are using npm (we will use yarn in the following instructions, it's ok to replace yarn with npm)
|
||||
|
@ -11,10 +11,14 @@ title: 在 TypeScript 中使用
|
||||
|
||||
请确保电脑上已经安装了最新版的 [yarn](https://yarnpkg.com) 或者 [npm](https://www.npmjs.com/)。
|
||||
|
||||
使用 yarn 创建项目。
|
||||
使用 yarn 创建 [cra-template-typescript](https://github.com/facebook/create-react-app/tree/master/packages/cra-template-typescript) 项目。
|
||||
|
||||
```bash
|
||||
$ yarn create react-app antd-demo-ts --typescript
|
||||
$ yarn create react-app antd-demo-ts --template typescript
|
||||
|
||||
# or
|
||||
|
||||
npx create-react-app my-app --template typescript
|
||||
```
|
||||
|
||||
如果你使用的是 npm(接下来我们都会用 yarn 作为例子,如果你习惯用 npm 也没问题)。
|
||||
|
@ -13,6 +13,10 @@ Before all start, you may need install [yarn](https://github.com/yarnpkg/yarn/).
|
||||
|
||||
```bash
|
||||
$ yarn create react-app antd-demo
|
||||
|
||||
# or
|
||||
|
||||
$ npx create-react-app antd-demo
|
||||
```
|
||||
|
||||
The tool will create and initialize environment and dependencies automatically, please try config your proxy setting or use another npm registry if any network errors happen during it.
|
||||
|
@ -13,6 +13,10 @@ title: 在 create-react-app 中使用
|
||||
|
||||
```bash
|
||||
$ yarn create react-app antd-demo
|
||||
|
||||
# or
|
||||
|
||||
$ npx create-react-app antd-demo
|
||||
```
|
||||
|
||||
工具会自动初始化一个脚手架并安装 React 项目的各种必要依赖,如果在过程中出现网络问题,请尝试配置代理或使用其他 npm registry。
|
||||
|
Loading…
Reference in New Issue
Block a user