My React Native TypeScript setup is showing react-native/types
instead of react-native
in IntelliSense. How can I fix this issue?
I initialized my project using
npx create-expo-app MyApp --template Typescript
.
Here is my tsconfig.json
configuration.
{
"extends": "expo/tsconfig.base",
"compilerOptions": {
"strict": true,
"jsx": "react"
},
"exclude": ["node_modules"]
}
I have already added @types/react-native
as a dev dependency. Below is my package.json
file.
"dependencies": {
"expo": "~48.0.10",
"expo-status-bar": "~1.4.4",
"react": "18.2.0",
"react-native": "0.71.6"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@types/react": "~18.0.14",
"@types/react-native": "^0.71.5",
"typescript": "^4.9.4"
},