Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Module '"./node_modules/react-native"' has no exported member '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>
 );
}
like image 422
javed Avatar asked Jul 12 '26 00:07

javed


2 Answers

  1. Delete your node_modules folder
  2. run this on your terminal npm install @types/react @types/react-native
  3. close the editor and restart everything.
like image 122
Nahiduzzaman Avatar answered Jul 14 '26 12:07

Nahiduzzaman


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

like image 30
DinhNguyen Avatar answered Jul 14 '26 12:07

DinhNguyen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!