Jordan Dobrev
Jordan Dobrev

Reputation: 71

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

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

Upvotes: 7

Views: 4857

Answers (2)

Ehsan Sarshar
Ehsan Sarshar

Reputation: 3211

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

Upvotes: 3

Caleb Larsen
Caleb Larsen

Reputation: 749

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

Upvotes: 13

Related Questions