This is my folder structure. I have started this app with expo. Somehow i am not able to run it because of the following error.
Rootstack.js
import React from 'react';
import { createSwitchNavigator } from 'react-navigation';
import { createStackNavigator } from 'react-navigation-stack';
import LoginComponent from "../component/login/login";
import HomeComponent from "../component/home/home"
const AuthNav = createStackNavigator({
Login:{
screen : LoginComponent,
navigationOptions:{
headerShown: false
}
},
});
const AppNav = createStackNavigator({
Home:{
screen : HomeComponent,
tabBarLabel: 'Home',
navigationOptions:{
headerShown: false
}
},
});
const switchNav = createSwitchNavigator({
AuthNav,
AppNav
},{
initialRouteName:"AuthNav"
});
export default switchNav;
App.js inside stack folder
import { createAppContainer } from 'react-navigation'
import App from './stack/RootStack'
import { AppRegistry } from 'react-native';
AppRegistry.registerComponent('main',() => App);
export default createAppContainer(App);
main app.js
import App from './src/App.js';
export default App;
Error
Invariant Violation: Tried to register two views with the same name RNCSafeAreaProvider
Error 2
Invariant Violation: "main" has not been registered. This can happen if:
* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.
Which part i am doing wrong here .