'Stack.Navigator' cannot be used as a JSX component. When create a new project using expo init `demo`

I created new project using expo init demo
& selected tabs (TypeScript)

Following error showing. in vscode (Its not vscode issue i verified)

‘Stack.Navigator’ cannot be used as a JSX component.
Its element type 'ReactElement<any, any> …

Plz go through screenshot.

But project works fine.

This is an issue related to the version of @types/react with the current version of React Native. You will have to add the following snippet to the package.json file:

"resolutions": {
    "@types/react": "17.0.44"
  },

After adding the above snippet, please run yarn install from the root of your Expo project.

1 Like

Thanks! It works fine now.

1 Like