How to go to parent stack navigation screen from child drawer navigation
up vote
0
down vote
favorite
I have a Drawer navigation and stack navigation on my app.
export const AppDrawerNavigator = createDrawerNavigator(
{
Home: {
screen: Home,
navigationOptions: {
drawerIcon: ({ tintColor }) => (
<Icon name="home" style={{ fontSize: 24, color: tintColor }} />
)
}
},
MyAccount: {
screen: MyAccount,
navigationOptions: {
drawerIcon: ({ tintColor }) => (
<Icon name="paper" style={{ fontSize: 24, color: tintColor }} />
)
}
},
Cashback: {
screen: Cashback,
navigationOptions: {
drawerIcon: ({ tintColor }) => (
<Icon name="pizza" style={{ fontSize: 24, color: tintColor }} />
)
}
},
Settings: {
screen: Settings,
navigationOptions: {
drawerIcon: ({ tintColor }) => (
<Icon name="settings" style={{ fontSize: 24, color: tintColor }} />
)
}
},
Campaigns: {
screen: Campaigns,
navigationOptions: {
drawerIcon: ({ tintColor }) => (
<Icon name="call" style={{ fontSize: 24, color: tintColor }} />
)
}
}
},
{
contentComponent: CustomDrawerComponent,
contentOptions: { activeTintColor: "#60c2a2" }
}
);
export const AppStackNavigator = createStackNavigator(
{
OnBoarding: {
screen: OnBoardingContent
},
Login: {
screen: Login
},
MarchantLogin: {
screen: MarchantLogin
},
OTPScreen: {
screen: OTPScreen
},
Home: {
screen: Home
},
Drawer: {
screen: AppDrawerNavigator
}
},
{
headerMode: "none",
initialRouteName: "Drawer",
navigationOptions: {
headerVisible: false
}
}
);
Then I call this on
render() {
if (this.state.is_verified == "true") {
return <AppStackNavigator />;
} else {
return <OnBoarding />;
}
}
My problem is that when I click on logout inside Drawer button I need to route to OnBoarding component. But how is it possible?
Please help me to solve this or suggest me a better idea because I'm new to this stack. Thankyou.
reactjs react-native react-navigation react-navigation-stack react-navigation-drawer
add a comment |
up vote
0
down vote
favorite
I have a Drawer navigation and stack navigation on my app.
export const AppDrawerNavigator = createDrawerNavigator(
{
Home: {
screen: Home,
navigationOptions: {
drawerIcon: ({ tintColor }) => (
<Icon name="home" style={{ fontSize: 24, color: tintColor }} />
)
}
},
MyAccount: {
screen: MyAccount,
navigationOptions: {
drawerIcon: ({ tintColor }) => (
<Icon name="paper" style={{ fontSize: 24, color: tintColor }} />
)
}
},
Cashback: {
screen: Cashback,
navigationOptions: {
drawerIcon: ({ tintColor }) => (
<Icon name="pizza" style={{ fontSize: 24, color: tintColor }} />
)
}
},
Settings: {
screen: Settings,
navigationOptions: {
drawerIcon: ({ tintColor }) => (
<Icon name="settings" style={{ fontSize: 24, color: tintColor }} />
)
}
},
Campaigns: {
screen: Campaigns,
navigationOptions: {
drawerIcon: ({ tintColor }) => (
<Icon name="call" style={{ fontSize: 24, color: tintColor }} />
)
}
}
},
{
contentComponent: CustomDrawerComponent,
contentOptions: { activeTintColor: "#60c2a2" }
}
);
export const AppStackNavigator = createStackNavigator(
{
OnBoarding: {
screen: OnBoardingContent
},
Login: {
screen: Login
},
MarchantLogin: {
screen: MarchantLogin
},
OTPScreen: {
screen: OTPScreen
},
Home: {
screen: Home
},
Drawer: {
screen: AppDrawerNavigator
}
},
{
headerMode: "none",
initialRouteName: "Drawer",
navigationOptions: {
headerVisible: false
}
}
);
Then I call this on
render() {
if (this.state.is_verified == "true") {
return <AppStackNavigator />;
} else {
return <OnBoarding />;
}
}
My problem is that when I click on logout inside Drawer button I need to route to OnBoarding component. But how is it possible?
Please help me to solve this or suggest me a better idea because I'm new to this stack. Thankyou.
reactjs react-native react-navigation react-navigation-stack react-navigation-drawer
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a Drawer navigation and stack navigation on my app.
export const AppDrawerNavigator = createDrawerNavigator(
{
Home: {
screen: Home,
navigationOptions: {
drawerIcon: ({ tintColor }) => (
<Icon name="home" style={{ fontSize: 24, color: tintColor }} />
)
}
},
MyAccount: {
screen: MyAccount,
navigationOptions: {
drawerIcon: ({ tintColor }) => (
<Icon name="paper" style={{ fontSize: 24, color: tintColor }} />
)
}
},
Cashback: {
screen: Cashback,
navigationOptions: {
drawerIcon: ({ tintColor }) => (
<Icon name="pizza" style={{ fontSize: 24, color: tintColor }} />
)
}
},
Settings: {
screen: Settings,
navigationOptions: {
drawerIcon: ({ tintColor }) => (
<Icon name="settings" style={{ fontSize: 24, color: tintColor }} />
)
}
},
Campaigns: {
screen: Campaigns,
navigationOptions: {
drawerIcon: ({ tintColor }) => (
<Icon name="call" style={{ fontSize: 24, color: tintColor }} />
)
}
}
},
{
contentComponent: CustomDrawerComponent,
contentOptions: { activeTintColor: "#60c2a2" }
}
);
export const AppStackNavigator = createStackNavigator(
{
OnBoarding: {
screen: OnBoardingContent
},
Login: {
screen: Login
},
MarchantLogin: {
screen: MarchantLogin
},
OTPScreen: {
screen: OTPScreen
},
Home: {
screen: Home
},
Drawer: {
screen: AppDrawerNavigator
}
},
{
headerMode: "none",
initialRouteName: "Drawer",
navigationOptions: {
headerVisible: false
}
}
);
Then I call this on
render() {
if (this.state.is_verified == "true") {
return <AppStackNavigator />;
} else {
return <OnBoarding />;
}
}
My problem is that when I click on logout inside Drawer button I need to route to OnBoarding component. But how is it possible?
Please help me to solve this or suggest me a better idea because I'm new to this stack. Thankyou.
reactjs react-native react-navigation react-navigation-stack react-navigation-drawer
I have a Drawer navigation and stack navigation on my app.
export const AppDrawerNavigator = createDrawerNavigator(
{
Home: {
screen: Home,
navigationOptions: {
drawerIcon: ({ tintColor }) => (
<Icon name="home" style={{ fontSize: 24, color: tintColor }} />
)
}
},
MyAccount: {
screen: MyAccount,
navigationOptions: {
drawerIcon: ({ tintColor }) => (
<Icon name="paper" style={{ fontSize: 24, color: tintColor }} />
)
}
},
Cashback: {
screen: Cashback,
navigationOptions: {
drawerIcon: ({ tintColor }) => (
<Icon name="pizza" style={{ fontSize: 24, color: tintColor }} />
)
}
},
Settings: {
screen: Settings,
navigationOptions: {
drawerIcon: ({ tintColor }) => (
<Icon name="settings" style={{ fontSize: 24, color: tintColor }} />
)
}
},
Campaigns: {
screen: Campaigns,
navigationOptions: {
drawerIcon: ({ tintColor }) => (
<Icon name="call" style={{ fontSize: 24, color: tintColor }} />
)
}
}
},
{
contentComponent: CustomDrawerComponent,
contentOptions: { activeTintColor: "#60c2a2" }
}
);
export const AppStackNavigator = createStackNavigator(
{
OnBoarding: {
screen: OnBoardingContent
},
Login: {
screen: Login
},
MarchantLogin: {
screen: MarchantLogin
},
OTPScreen: {
screen: OTPScreen
},
Home: {
screen: Home
},
Drawer: {
screen: AppDrawerNavigator
}
},
{
headerMode: "none",
initialRouteName: "Drawer",
navigationOptions: {
headerVisible: false
}
}
);
Then I call this on
render() {
if (this.state.is_verified == "true") {
return <AppStackNavigator />;
} else {
return <OnBoarding />;
}
}
My problem is that when I click on logout inside Drawer button I need to route to OnBoarding component. But how is it possible?
Please help me to solve this or suggest me a better idea because I'm new to this stack. Thankyou.
reactjs react-native react-navigation react-navigation-stack react-navigation-drawer
reactjs react-native react-navigation react-navigation-stack react-navigation-drawer
edited Nov 10 at 14:52
asked Nov 10 at 14:42
SOBIR N
18519
18519
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53240033%2fhow-to-go-to-parent-stack-navigation-screen-from-child-drawer-navigation%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password