Skip to content

Commit a7212db

Browse files
Add missing instruction if you are adding typescript
When adding typescript to an existing Create React App project you have to have tsconfig.json in the project, I believe this change should clarify it for beginners getting stuck on this step. Not sure if providing an example would be too much so I have added a link to the tsconfig.json instead.
1 parent cee2658 commit a7212db

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docusaurus/docs/adding-typescript.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ or
3737
yarn add typescript @types/node @types/react @types/react-dom @types/jest
3838
```
3939

40-
Next, rename any file to be a TypeScript file (e.g. `src/index.js` to `src/index.tsx`) and **restart your development server**!
40+
Next, rename any file to be a TypeScript file (e.g. `src/index.js` to `src/index.tsx`) and create tsconfig.json if it's not in the root of your project [`tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html).
41+
42+
Finally **restart your development server**!
4143

4244
Type errors will show up in the same console as the build one. You'll have to fix these type errors before you continue development or build your project. For advanced configuration, [see here](advanced-configuration.md).
4345

0 commit comments

Comments
 (0)