Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Solve the issue of casting using 'as' keyword in .tsx files
  • Loading branch information
amehdaly committed Feb 14, 2021
commit 4f7bc2ec0259d44c1181713bba31b03ed0fe4bbc
10 changes: 9 additions & 1 deletion docusaurus/docs/adding-typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@ npm install --save typescript @types/node @types/react @types/react-dom @types/j

yarn add typescript @types/node @types/react @types/react-dom @types/jest
```

Next, add the following to `package.json` :
```json
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
}
```
Next, rename any file to be a TypeScript file (e.g. `src/index.js` to `src/index.tsx`) and **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