Getting typing errors after upgrading expo project

Viewed 184

I upgraded my project from expo 44 to expo 45 and now I have inumerous errors like this:

The module 'MaterialIcons' can't be used as JSX component.

This error is happening with many libraries like react-native-paper, react-native-elements and even the native ones like expo-vector-icons.

If I rollback the upgrade everything gets back to normal, but I need to update to avoid having to do this later.

obs: I'm using typescript

1 Answers

Solved my problem by adding:

"resolutions": {
    "@types/react": "^17"
}

to my package.json file.

It looks like yarn was using two different @types/react for the libraries, and this solved the issue.

Related