I have installed react-navigation in my React Native project. Its a starter project doesn't have any codes. But while running project I am facing error like this.
Here is my Navigation code
import { createStackNavigator } from 'react-navigation'; import Home from './screens/Home'; import WeatherDetail from './screens/WeatherDetail'; const Navigation = createStackNavigator({ Home: { screen: Home }, WeatherDetail: { screen: WeatherDetail } }); export default Navigation;
And here is the App.js codes
import Navigator from './Router'; export default class App extends Component { render() { return ( <View style={styles.container}> <Navigator /> </View> ); } }
If I remove the navigator component from the App.js and replace it with a Text the application runs without any error.
npm install
npm install --save react-navigation
npm install --save react-native-gesture-handler
react-native link
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With