aksonov / react-native-router-flux

The first declarative React Native router
MIT License
8.99k stars 2.11k forks source link

Drawer navbar shows even when drawer is closed #3309

Closed RobinJayaswal closed 5 years ago

RobinJayaswal commented 5 years ago

v4.0.5

I just upgraded from v4.x.x.beta to v4.0.5. I did not change any of my code (shown below), but suddenly the navigation bar on my Drawer scene always shows, not just when my drawer is open. It used to work as expected, only showing the drawer navigation bar when the drawer was open. Now I get stacked navbars when the subscenes also have a navbar.

Is this expected behavior in the latest? And if so, how would you recommend having a navbar on my drawer component that only shows when the drawer is open?

 <Scene
              key="drawer"
              contentComponent={MyDrawerComponent}
              type="replace"
              ....
              drawerLockMode="locked-open"
              navigationBarStyle={styles.navigationBarWithBackButton} // NOTE: this navbar now shows always, even when the drawer is closed
              renderLeftButton={customLeftBackButton}
              renderRightButton={customRightSettingsButton}
              drawer
 >
    <Tabs
         key="main"
         drawerLockMode="locked-open"
          navigationBarStyle={styles.homeNavigationBar}
    >
      ....
    </Tabs>
</Scene>
RobinJayaswal commented 5 years ago

A workaround I can do is making MyDrawerComponent have a navbar directly, and just having hideNavBar on my top level drawer scene. But I am wondering if there is a more natural way to achieve my desired behavior.

aksonov commented 5 years ago

Your approach is correct, I'm closing this issue