Create-react-app: Use `npx create-react-app App --template typescript` to build the project, `tsconfig.json` file has an error

Created on 20 Nov 2020  路  4Comments  路  Source: facebook/create-react-app

Most helpful comment

It's resolved in the following way:

  1. "Ctrl + Shift + P" or Click Typescript version at the bottom right of the window.
  2. TypeScript: Select TypeScript Version
  3. Use Workspace Version... 4.1.2

All 4 comments

Used yarn eject

This is not an error, your VS Code probably hasn't picked up on the new schema for tsconfig.json as react-jsx and react-jsxdev are newly introduced JSX factories starting with Typescript 4.1 and thus valid values in this context. For me personally VS Code doesn't show any error and even offers them during code completion.

It's resolved in the following way:

  1. "Ctrl + Shift + P" or Click Typescript version at the bottom right of the window.
  2. TypeScript: Select TypeScript Version
  3. Use Workspace Version... 4.1.2
Was this page helpful?
0 / 5 - 0 ratings