2
I’m trying to start a project with React Native. But when I try to use the React-navigation this error appears.
App.js:
import React from "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 the React-navigation with the following command:
npm install --save react-navigation
But the error persists in insisting.
It worked correctly. Thanks!
– Vinícius Fernandes
Solved for me too! Thanks!!
– reisdev
Worked out here too!
– william.web
You are the guy. For those who are entering this world of the React/React-Native lack a lot of information :(
– Joubert Vasconcelos