New JSX Transform. React 16.14, Typescript 4.1.0-beta and react-scripts 4.0.0-next.98 not working

Viewed 1351

Based on https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports

My package.json

"react": "^16.14.0",
"react-dom": "^16.14.0",
"react-scripts": "4.0.0-next.98",
"typescript": "^4.1.0-beta",

in package.json

"eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ],
    "rules": {
      "react/jsx-uses-react": "off",
      "react/jsx-uses-vars": "off",
      "react/react-in-jsx-scope": "off"
    }
  },

tsconfig.json

"jsx": "react-jsx"
*Value is not accepted. Valid values: "preserve", "react", "react-native"*

support for this can be found here: https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/#jsx-factories

After running showing the error 'React' must be in scope when using JSX.

Also, the Vscode typescript version is 4.1.0-dev

created template using

npx create-react-app@next --scripts-version=@next --template=typescript@next my-app

And in .env

EXTEND_ESLINT=true
1 Answers

worked when updated react 17.0.0, but doc shows support for 16.14.0

Related