component-template icon indicating copy to clipboard operation
component-template copied to clipboard

An issue happens at npm run start

Open chiehpower opened this issue 2 years ago • 0 comments

node version : v16.15.0 npm version : 8.5.5


Command: npm run start Error message:

Failed to compile.

Type error: JSX element type 'ReactElement<any, any> | Component<{}, any, any> | null' is not a constructor function for JSX elements.
  Type 'Component<{}, any, any>' is not assignable to type 'Element | ElementClass | null'.
    Type 'Component<{}, any, any>' is not assignable to type 'ElementClass'.
      The types returned by 'render()' are incompatible between these types.
        Type 'React.ReactNode' is not assignable to type 'import("/home/chieh/472GB/github/node_modules/@types/react/index").ReactNode'.
          Type '{}' is not assignable to type 'ReactNode'.
            Type '{}' is missing the following properties from type 'ReactPortal': key, children, type, props  TS2605

     5 | ReactDOM.render(
     6 |   <React.StrictMode>
  >  7 |     <MyComponent />
       |     ^
     8 |   </React.StrictMode>,
     9 |   document.getElementById("root")
    10 | )

chiehpower avatar May 27 '22 01:05 chiehpower