0

Here is the current structure of the navigators

-Stack navigator
   - Splash
   - Login
   - Home (Drawer Navigator)
       - Users (Stack Navigator)
           - Users List
           - User Detail ( this screen contains the screen products list of a user)
       - Products (Stack Navigator)
           - Products List
           - Product Details

I am able to navigate from user detail screen to product detail screen as described by the docs. Nested navigation

navigation.navigate('Products', { screen: 'Product Details' });

But doing this replaces the initialRouteName which was products list at first with product details and it will be shown as the first screen when navigating to products forever. So after that the initial route will be product details. What am I doing wrong?

hamidify
  • 26
  • 1
  • 2
  • I've actually just run into this same problem. Did you ever find a solution? – AP Fritts Dec 07 '20 at 08:12
  • 1
    @APFritts yes, I found a solution. You have to be at V5.1.6 of react-navigation and you can do something like this. `navigation.navigate('Products', { screen: 'ProductDetails', initial: false, });` The parameter passed as `initial` will determine which screen will be used as an initial route on that Navigator. – hamidify Dec 07 '20 at 18:42

0 Answers0