File tree 1 file changed +10
-6
lines changed
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -10,17 +10,21 @@ title: Adding TypeScript
10
10
To start a new Create React App project with [ TypeScript] ( https://www.typescriptlang.org/ ) , you can run:
11
11
12
12
``` 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
16
18
```
17
19
18
20
To add [ TypeScript] ( https://www.typescriptlang.org/ ) to a Create React App project, first install it:
19
21
20
22
``` 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
24
28
```
25
29
26
30
Next, 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