Skip to content

Commit

Permalink
Add missing instruction if you are adding typescript
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pawelskowronek authored Jun 23, 2022
1 parent cee2658 commit a7212db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docusaurus/docs/adding-typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ or
yarn add typescript @types/node @types/react @types/react-dom @types/jest
```

Next, rename any file to be a TypeScript file (e.g. `src/index.js` to `src/index.tsx`) and **restart your development server**!
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).

Finally **restart your development server**!

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).

Expand Down

0 comments on commit a7212db

Please sign in to comment.