Stack Navigator "Root" --Stack Navigation A -- SN Login -- SN Signup -- SN HOME Initial Route is "LOGIN"
HOME contain tab navigation --Tab Navigator
--- TAB Navigator A
----Screen "Setting"
--- TAB Navigator B
----Screen "1"
----Screen "Setting"
App.js
const AppNavigator = StackNavigator({
Login: {
screen: Login
},
SignUp: {
screen: SignUp
},
TermsConditions: {
screen: TermsConditions
},
Home: {
screen: Home
},
Setting: {
screen: Setting
}
}, {
initialRouteName: "Login",
headerMode: "none",
// mode: 'modal',
navigationOptions: {
gesturesEnabled: false
}
});
When user login, navigate to "Home" screen -- End open the Truck as initial route. Home.js
const HomeNavigation = StackNavigator(
{
Home: {
screen: Trucks
},
TruckDetailController: {
screen: TruckDetailController
},
Setting: {
screen: Setting
},
{
initialRouteName: "Home",
headerMode: "none"
}
);
const FavouriteNavigation = StackNavigator(
{
Favourite: {
screen: Favourite
},
TruckDetailController: {
screen: TruckDetailController
},
Setting: {
screen: Setting
},
{
initialRouteName: "Favourite",
headerMode: "none"
}
);
const TabRoute = TabRouter(
{
Trucks: {
screen: HomeNavigation
},
Favourite: {
screen: FavouriteNavigation
},
Loyalty: {
screen: Loyalty
},
Offer: {
screen: Offer
}
},
{ initialRouteName: "Trucks" }
);
I Just want to logout from setting and switch to "Stack Navigation A -- Login" screen.
If anybody will give the solution for above so its appreciable and make a good point. :)