1

I wanted to use JS type checking capability inside VScode. Everything works like charm but React.Fragment is linted with error:

JSX element type 'ReactElement<any>' is not a constructor function for JSX elements.
Type 'ReactElement<any>' is missing the following properties from type 'Element': nodeName, attributes, childrents(2605)

And this is not all, even imported components from material-ui show simillar ts(2605) error.

My jsconfig.json is:

{
    "compilerOptions": {
        "module": "commonjs",
        "checkJs": true,
        "target": "esnext",
        "jsx": "react",
        "allowSyntheticDefaultImports": true
    },
    "include": [
        "./**/*"
    ]
}

Can someone help me please to find out what am I doing wrong?

Thanks.

palci12
  • 179
  • 1
  • 3
  • 12

1 Answers1

0

this is a problem about @types/react, Downgraded to "@types/react": "16.7.13".

yarn add @types/react@16.7.13
Scc
  • 446
  • 5
  • 4