After i convert my project in typescript showing me following error Module '"./node_modules/react-native"' has no exported member 'View'.
import React from 'react';
import {StyleSheet,View,Text} from 'react-native';
export default function App() {
return (
<View style={{ flex: 1 }}>
<Text>Welcome</Text>
</View>
);
}
After i convert my project in typescript showing me following error Module '"./node_modules/react-native"' has no exported member 'View'.
import React from 'react';
import {StyleSheet,View,Text} from 'react-native';
export default function App() {
return (
<View style={{ flex: 1 }}>
<Text>Welcome</Text>
</View>
);
}
Share
Improve this question
asked Jan 27, 2021 at 7:04
javedjaved
4164 silver badges11 bronze badges
1
|
3 Answers
Reset to default 15- Delete your
node_modules
folder - run this on your terminal
npm install @types/react @types/react-native
- close the editor and restart everything.
Delete node_modules
folder and run npm install
or yarn
again.
If it not solve this problem, try to run npm install @types/react @types/react-native
or yarn add @types/react @types/react-native
Probably you should also use -D option to install it as a development dependency, which adds it to the devDependencies list.
npm install --save-dev @types/react @types/react-native
(npm install -D @types/react @types/react-native)
or
yarn add --dev @types/react @types/react-native
(yarn add -D @types/react @types/react-native)
nodemodules
folder and donpm install
again – prasanth Commented Jan 27, 2021 at 7:27