mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-23 20:51:12 +08:00
Add template support (#7716)
* Add template support * Update templates version check * Update TypeScript template README
This commit is contained in:
committed by
Ian Sutherland
parent
e92db94313
commit
4c0c81953d
@@ -12,14 +12,16 @@ title: Adding TypeScript
|
||||
To start a new Create React App project with [TypeScript](https://www.typescriptlang.org/), you can run:
|
||||
|
||||
```sh
|
||||
npx create-react-app my-app --typescript
|
||||
npx create-react-app my-app --template typescript
|
||||
|
||||
# or
|
||||
|
||||
yarn create react-app my-app --typescript
|
||||
yarn create react-app my-app --template typescript
|
||||
```
|
||||
|
||||
> If you've previously installed `create-react-app` globally via `npm install -g create-react-app`, we recommend you uninstall the package using `npm uninstall -g create-react-app` to ensure that `npx` always uses the latest version.
|
||||
>
|
||||
> Global installs of `create-react-app` are no longer supported.
|
||||
|
||||
To add [TypeScript](https://www.typescriptlang.org/) to a Create React App project, first install it:
|
||||
|
||||
@@ -49,5 +51,4 @@ If your project is not created with TypeScript enabled, npx may be using a cache
|
||||
|
||||
If you are currently using [create-react-app-typescript](https://github.com/wmonk/create-react-app-typescript/), see [this blog post](https://vincenttunru.com/migrate-create-react-app-typescript-to-create-react-app/) for instructions on how to migrate to Create React App.
|
||||
|
||||
|
||||
Constant enums and namespaces are not supported, you can learn about the constraints of [using Babel with TypeScript here](https://babeljs.io/docs/en/babel-plugin-transform-typescript#caveats).
|
||||
|
||||
Reference in New Issue
Block a user