My App.js file code is like this
import { createAppContainer } from "react-navigation";
import { createStackNavigator } from "react-navigation-stack";
import IndexScreen from "./src/screen/IndexScreen";
const navigator = createStackNavigator({
Home: {
screen: IndexScreen
}
});
export default createAppContainer(navigator);
And my index.js file is like
import { React } from "react";
import { View, Text, StyleSheet } from "react-native";
const IndexScreen = () => {
return (
<View>
<Text>IndexScreeen</Text>
</View>
);
};
const styles = StyleSheet.create({});
export default IndexScreen;
But after running the application I am getting this error.

What is my mistake
IndexScreenas a class that extendsReact.Componentand have a functionrender()inside? Also, your file is namedindex.jsand you are trying to import fileIndexScreen?