skip to Main Content

‘TouchableOpacity’ cannot be used as a JSX component.
Its instance type ‘TouchableOpacity’ is not a valid JSX element.
The types returned by ‘render()’ are incompatible between these types.
Type ‘import("/Users/sanjeevkumar/React/help_idea_update/mypatapp-v2-update/node_modules/@types/react-native/node_modules/@types/react/index").ReactNode’ is not assignable to type ‘React.ReactNode’.

enter image description here

why this is giving error message i already do this

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

and run yarn install

2

Answers


  1. The warning is coming from typescript.

    Update the following

    "@types/react": "17.0.14",
    

    For "@types/react-native", update to same version as the react-native and install again.

    Login or Signup to reply.
  2. The warning is coming from typescript.

    Update the "@types/react" to save version as the react version.

    Same for @types/react-dom in your de dependencies

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search