I'm trying to start a project with React Native . But when I try to use react-navigation this error appears.
App.js:
importReactfrom"react";
import { View, Text } from "react-native";
import { createStackNavigator, createAppContainer } from "react-navigation";
class HomeScreen extends React.Component {
render() {
return (
<View style={{ flex: 1, alignItems: "center", justifyContent: "center" }}>
<Text>Home Screen</Text>
</View>
);
}
}
const AppNavigator = createStackNavigator({
Home: {
screen: HomeScreen
}
});
export default createAppContainer(AppNavigator);
I copied the same page code Hello React Navigation
I installed react-navigation with the following command:
npm install --save react-navigation
But the error persists in insisting.