File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -10,17 +10,21 @@ title: Adding TypeScript
1010To start a new Create React App project with [ TypeScript] ( https://www.typescriptlang.org/ ) , you can run:
1111
1212``` bash
13- $ npx create-react-app my-app --typescript
14- $ # or
15- $ yarn create react-app my-app --typescript
13+ npx create-react-app my-app --typescript
14+
15+ # or
16+
17+ yarn create react-app my-app --typescript
1618```
1719
1820To add [ TypeScript] ( https://www.typescriptlang.org/ ) to a Create React App project, first install it:
1921
2022``` bash
21- $ npm install --save typescript @types/node @types/react @types/react-dom @types/jest
22- $ # or
23- $ yarn add typescript @types/node @types/react @types/react-dom @types/jest
23+ npm install --save typescript @types/node @types/react @types/react-dom @types/jest
24+
25+ # or
26+
27+ yarn add typescript @types/node @types/react @types/react-dom @types/jest
2428```
2529
2630Next, rename any file to be a TypeScript file (e.g. ` src/index.js ` to ` src/index.tsx ` ) and ** restart your development server** !
You can’t perform that action at this time.
0 commit comments