First let me state that I know how to navigate from one nested page to another using react navigation. However, whenever i navigate to a nested screen that is not the initial route, that screen now become the first screen whenever i navigate back to that nested stack.
Example.
- Parent Navigator
- Nested Stack Navigator 1
- screen A (Initial Route)
- screen B
- Nested Stack Navigator 2
- screen C (Initial Route)
- screen D
- Nested Stack Navigator 2
- screen E (Initial Route)
- screen F
- Nested Stack Navigator 1
Normally when navigating from one stack to Nested Stack Navigator 2 the I use the following.
navigation.navigate('Nested Navigator 2');
Which takes me to screen C, this is the expected behaviour. However, whenever i'm navigating from another stack to screen D, I notice that whenever i navigate back to Nested Stack Navigator 2 with the above code it no longer opens up screen C it opens up screen D instead.
This is how I navigate to screen D from another stack.
navigation.navigate('Nested Navigator 2', { screen: 'screen D', initial: false });
Whenever this is used screen D acts as the initial route, event though I specified initial: false in the navigation call. Is there a way to prevent this?