Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript typings issue #4208

Closed
ScreamZ opened this issue Apr 25, 2022 · 1 comment
Closed

Typescript typings issue #4208

ScreamZ opened this issue Apr 25, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@ScreamZ
Copy link

ScreamZ commented Apr 25, 2022

Within the latest version, when I Start a new Expo project I'm getting the following ts error

I'm having issues understanding why

'MapView' cannot be used as a JSX component.
  Its instance type 'MapView' is not a valid JSX element.
    The types returned by 'render()' are incompatible between these types.
      Type 'React.ReactNode' is not assignable to type 'import("/Users/screamz/js-dev/pro/stride/stride-new-mobile-app/node_modules/@types/react-native/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, propsts(2786)

Reproduction

npm i -g expo-cli
expo init -> Typescript starter
expo install react-native-maps-> "react-native-maps": "0.29.4" given

Try to use <MapView /> within a component in a .tsx file

@ScreamZ ScreamZ added the bug Something isn't working label Apr 25, 2022
@ScreamZ
Copy link
Author

ScreamZ commented Apr 25, 2022

Looks related to

Solution

Add to package.json

"resolutions": { "@types/react": "~17.0.21" },

@monholm monholm closed this as completed Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants