0

I upgrade version @nrwl/workspace version @14, so it upgrade react @18, but i have error:

 'SwipeableViews' cannot be used as a JSX component.
  Its instance type 'SwipeableViews' is not a valid JSX element.
    The types returned by 'render()' are incompatible between these types.
      Type 'import("/media/user/DATA/Admin/project/node_modules/@types/react-dom/node_modules/@types/react/index").ReactNode' is not assignable to type 'React.ReactNode'.
        Type '{}' is not assignable to type 'ReactNode'.

My environments:

"react": "18.0.0",
"@types/react": "18.0.1",
"@types/react-dom": "^18.0.0",
"react-swipeable-views": "^0.14.0",
"@types/react-swipeable-views": "^0.13.0",
"nx": "14.0.0",
"typescript": "4.4.2",
"workbox-cli": "^6.1.5",

I post

"resolutions": {
    "@types/react": "17.0.2",
    "@types/react-dom": "17.0.2"
  }

and delete node_modules, run yarn but it fail

  • I have answered it [here](https://stackoverflow.com/questions/73019348/component-cannot-be-used-as-a-jsx-component-its-element-type-reactelementan/73019448#73019448). Hope this helps. – RKataria Sep 27 '22 at 07:05

0 Answers0