Skip to content

Commit 3c11efe

Browse files
brunolemosTimer
authored andcommitted
Simplified TypeScript steps (facebook#5533)
1 parent c6cdf42 commit 3c11efe

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

docusaurus/docs/adding-typescript.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ Recent versions of [TypeScript](https://www.typescriptlang.org/) work with Creat
1010
To add TypeScript to a Create React App project, follow these steps:
1111

1212
1. Run `npm install --save typescript @types/react @types/react-dom @types/jest` (or `yarn add typescript @types/react @types/react-dom @types/jest`).
13-
2. Rename the `.js` files you want to convert: use `.tsx` if they use JSX or `.ts` if not (e.g. `git mv src/index.js src/index.tsx`).
14-
3. Create a [`tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) at the root project directory with `{}` in it. Alternatively, rename `index.js` to `index.tsx`.
15-
4. Restart your development server (if applicable). This will set sensible defaults and the required values in your [`tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html).
13+
2. Rename `src/index.js` to `src/index.tsx` or create an empty [`tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) at the root project directory.
14+
3. Restart your development server (if applicable). This will set sensible defaults and the required values in your [`tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html).
1615

1716
Type errors will show up in the same console as the build one.
1817

0 commit comments

Comments
 (0)