React Native/Typescript - Error Module '"react-native"' has no exported member 'Pressable'.ts(2305)

Viewed 2433

I cannot seem to remove this error message and don't know exactly where it comes from. Pressable is indeed a working component, but the thing that shouts at me doesn't understand that. What is it and how to fix it?

I tried updating react and react-native versions to latest, also tried upgrading typescript version to latest and still the error persists (the code runs fine though).

This is what it looks like if I'm unclear

2 Answers

In my case I needed to update my @types/react-native dependency in package.json to "@types/react-native": "^0.63.25",

remove @types/react-native from package.json if exists.

then yarn add --dev @types/react-native or npm install --save-dev @types/react-native to install the latest version

Related