-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Closed
Labels
Description
This is my current nav stack:
const AppNavigator = StackNavigator({
Welcome: {
screen: WelcomeScreen,
},
Login: {
screen: LoginScreen,
},
Main: {
screen: ({ navigation }) => <DrawerNavigator screenProps={{ rootNavigation: navigation }} />,
path: 'main',
},
}, { headerMode: 'none' });
const DrawerNav = DrawerNavigator({
Home: {
screen: HomeScreen,
},
Notifications: {
screen: NotificationsNavigator,
},
}, {
initialRouteName: 'Home',
contentComponent: DrawerContent,
});
NotificationsNavigator is a Stack navigator with routes: Notifications and Notification
I handle Push Notifications logic on WelcomeScreen (I also check here if the user is logged in)
What I need is to navigate from Welcome to Notification (Stack -> Drawer -> Stack)
I'm trying this, in WelcomeScreen:
const navigateAction = NavigationActions.navigate({
routeName: 'Main',
action: NavigationActions.navigate({
routeName: 'Notification',
params: { notificationId: '355' },
}),
});
navigation.dispatch(navigateAction);
Current Behavior
It navigates to Home.
First the action Navigation/INIT appears in AppNavigator
Then it appears the action I dispatch
Then in DrawerNav the action Navigation/INIT is shown.
software | version |
---|---|
react-navigation | 1.0.0-beta.11 |
react-native | 0.45.1 |
node | 7.10.0 |
npm or yarn | 4.2.0 / 0.17.10 |
Heru6664