Nesting navigators means displaying a navigator inside the screen of another navigator, for example:
In the above example, the
Home component contains a tabbed navigator. The
Home component is also used for the
Home screen in your stack navigator inside the
App component. So here's the tab navigator nested within the stack navigator:
Nested navigators work the same way as regular components. To achieve the desired behavior, it is often necessary to nest multiple navigators.
There are a few things to keep in mind when nesting navigators:
For example, when you press the back button while on screen in a nested stack navigator, it will return to the previous screen inside the nested stack, even if there is another navigator as the parent.
Thanks goes to these wonderful people (emoji key):