New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TabNavigator's tabs are not displayed when nested in a DrawerNavigator #38
Comments
I can confirm this issue, and it is also related to issue #31. I have tracked down this issue to the way The root cause of this seems to lie in getComponentForState(state: NavigationState) {
const routeName = order[state.index];
invariant(
routeName,
`There is no route defined for index ${state.index}. Check that
that you passed in a navigation state with a valid tab/screen index.`
);
const childRouter = tabRouters[routeName];
if (childRouter) {
return childRouter.getComponentForState(state.routes[state.index]);
}
return getScreenForRouteName(routeConfigs, routeName);
}, Bypassing/removing this recursion allows tabs and stacks inside drawers to function normally. However, I want to hold off on a PR as I assume this recursion is there for a reason, and I do not yet grok I believe that, ideally, DrawerNavigation should get its own router to cleanly separate concerns with TabRouter. @ericvicenti @skevy Any insight for us laypeople? |
Can confirm the same issue with embedding StackNavigators in a DrawerNavigator |
Maybe the drawer navigator should use the cc @satya164 |
I will attempt to push out a fix ASAP, in a few hours.
On 27 Jan 2017, at 18:58, Eric Vicenti <notifications@github.com<mailto:notifications@github.com>> wrote:
Maybe the drawer navigator should use the router.getComponentForRouteName instead? If you can find a fix inside the drawer navigator without changing any routers, then the PR would be quickly accepted!
cc @satya164<https://github.com/satya164>
-
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#38 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AJ32YF5FCRIKAMdCIev52Ktd0HkdPCGYks5rWjBMgaJpZM4Lv56d>.
|
Fixed in #46 |
Thanks @satya164! FYI, I was doing the same fix at the same time. I have tested it in the following scenarios:
... so we should be golden! |
Awesome! |
Wow 4 hours after my issue, thank you ! Best.Customer.Service.Ever |
How can we handle the scenarios of Drawer inside the Tab , Can you please point me to some working code ? |
That would be interesting. Or a way to have both - a TabNavigator and a DrawerNavigator. I have a project where I should have 3 Tabs on all screens and a drawer with other NavigationItems. |
Can you pls share the link ?
…Sent from my iPhone
On Jul 14, 2017, at 3:00 PM, Markus Günther ***@***.***> wrote:
That would be interesting. Or a way to have both - a TabNavigator and a DrawerNavigator.
I have a project where I should have 3 Tabs on all screens and a drawer with other NavigationItems.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Which link should I share? It is more or less a question ... will try to join this with a stacknavigator or so. |
Hi,
First, thank you for this module !
I have an issue when using a TabNavigator nested in a DrawerNavigator: tabs are not displayed.
This issue appears only when I go to the nested TabNavigator from the Drawer menu link and when using
navigate('MyNestedTabStack')
like in the get started guide.Here is an example:
The text was updated successfully, but these errors were encountered: