I am new to React Native. I created a new project using npx react-native init NewProject2. Then, I imported the project in VS Code. When I run my project on my Android device, it works fine but VS Code shows an error. This is my App.js :
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
*/
import React from 'react';
import {
SafeAreaView,
StyleSheet,
ScrollView,
View,
Text,
StatusBar,
} from 'react-native';
import {
Colors
} from 'react-native/Libraries/NewAppScreen';
import Login from './src/pages/Login';
const App: () => React$Node = () => {
return (
<View style={styles.container}>
<StatusBar
backgroundColor = "#e1ad01"
></StatusBar>
<Text style={{color:"#e1ad01",fontSize:18}}>Just some text!!</Text>
</View>
);
};
const styles = StyleSheet.create({
container : {
flex : 1,
backgroundColor:'#000000',
alignItems : "center",
justifyContent : "center"
}
});
export default App;
And this is my index.js :
/**
* @format
*/
import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
AppRegistry.registerComponent(appName, () => App);
My Login.js has the same error.