Skip to content
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

Show Drawer's nav bar when drawer is open. #3046

Closed
cxrod opened this issue May 22, 2018 · 1 comment
Closed

Show Drawer's nav bar when drawer is open. #3046

cxrod opened this issue May 22, 2018 · 1 comment

Comments

@cxrod
Copy link

cxrod commented May 22, 2018

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.0-beta.31 (v3 is not supported)
  • react-native v0.55.4

Expected behaviour

Show Drawer's nav bar when Drawer is open

Actual behaviour

Drawer show parent nav bar

This is my router:

<Stack key="root" hideNavBar>
    <Scene
      hideNavBar
      key="launcher"
      title="LAUNCHER"
      {...DefaultProps.navbarProps}
      component={LauncherContainer}
      Layout={LauncherComponent} />

    <Stack key="app">
      <Scene
        hideNavBar
        key="login"
        title="LOGIN"
        {...DefaultProps.navbarProps}
        component={LoginContainer}
        Layout={LoginComponent} />
      <Scene
        hideNavBar
        key="fingerprint"
        title="FINGERPRINT"
        {...DefaultProps.navbarProps}
        component={FingerprintContainer}
        Layout={FingerprintComponent} />

      <Scene
        drawer
        key="drawer"
        title="Menu"
        {...DefaultProps.navbarProps} >
        <Scene
          key="home"
          title="HOME"
          renderRightButton={() => <Logout />}
          {...DefaultProps.navbarProps}
          component={HomeContainer}
          Layout={HomeComponent} />
      </Scene>
    </Stack>
  </Stack>

Some screens

image

image

image

@daviscabral
Copy link
Collaborator

If I understood it right, that's the expected behavior - and it's documented on react-navigation. To have it behaving the way you want, you will need to reorganize your scenes in a different and more complex way. But in a nutshell, the scene containing the drawer need to be at the top level, or it will be nested.

Nesting DrawerNavigation
Please bear in mind that if you nest the DrawerNavigation, the drawer will show below the parent navigation.
https://v1.reactnavigation.org/docs/drawer-navigator.html#nesting-drawernavigation

@aksonov aksonov closed this as completed Jun 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants