Question: How to navigate in nested navigators?
See original GitHub issueFor example, I have this config:
const secondNavigator = new StateNavigator([
{ key: 'ScreenOne', trackCrumbTrail: true },
{ key: 'ScreenTwo', trackCrumbTrail: true },
]);
const { ScreenOne, ScreenTwo } = secondNavigator.states;
ScreenOne.renderScene = () => <ScreenOneComp />;
ScreenTwo.renderScene = () => <ScreenTwoComp />;
const stateNavigator = new StateNavigator([
{ key: 'MainApp', trackCrumbTrail: true },
{ key: 'nestedApp', trackCrumbTrail: true },
]);
const { MainApp, nestedApp } = stateNavigator.states;
MainApp.renderScene = () => <MainAppComp />;
nestedApp.renderScene = () => (
<NavigationHandler stateNavigator={secondNavigator}>
<NavigationStack />
</NavigationHandler>
);
export default () => (
<NavigationHandler stateNavigator={stateNavigator}>
<NavigationStack />
</NavigationHandler>
);
When I navigate to the nested navigator and press back - I get an error that there is nowhere to return to, because in the new navigator the state is empty (and it doesn’t have access to the main navigator?)
I guess I don’t completely understand how the navigator works that why it happens.
Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How to navigate between different nested stacks in react ...
Navigation.navigate now takes one object as the parameter. You set the stack name then navigate to the route within that stack as follows......
Read more >How to Navigate Between Nested Stacks? · Issue #983 - GitHub
So my question is this: how do you navigate between nested / leaf stacks? Or worded a different way: how do you make...
Read more >Nesting navigators - React Navigation
Nesting navigators means rendering a navigator inside a screen of another navigator, for example:
Read more >React Navigation v6 with TypeScript: Nested Navigation
A tutorial on how to set up nested navigation with full type-check for your React app using TypeScript.
Read more >20 React Navigation Interview Questions and Answers - CLIMB
5. What do you understand by nesting routes in React Navigation? ... Nesting routes refers to the ability to define child routes within...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Android and React better, ios less.
Just so that I know, what kind of stuff do you like working on? Android, iOS or React or all three?