0

hey there i a mworking with a react native project using React router flux for navigation everything is ok except that i want to hide the drawer from signin Screen and tuto screen here is my code bellow

const RouterRedux = connect()(Router);

<RouterRedux backAndroidHandler={() => {}}>
      <Drawer
        hideNavBar
        open={false}
        key="drawer"
        contentComponent={SideBar}
        drawerWidth={300}
        // drawerLockMode={show ? 'locked-closed' : 'unlocked'}>
      >
        <Scene key="root" hideNavBar transitionConfig={transitionConfig}>
          <Scene key="Tuto" component={Tuto} type={ActionConst.RESET} />
          <Scene
            initial
            key="CheckAuth"
            component={CheckAuth}
            type={ActionConst.RESET}
          />
          {/*<Scene key="WIP" component={WorkInProgress} />*/}
          <Scene key="SignIn" component={SignIn} />
          <Scene key="ResetPassword" component={ResetPassword} />
          <Scene key="Visits" component={Visits} />
          <Scene key="VisitDetails" component={VisitDetails} />
          <Scene key="Statistiques" component={Statistiques} />
          <Scene key="Notification" component={Notification} />
          <Scene key="Sync" component={Sync} />
        </Scene>
      </Drawer>
    </RouterRedux>

so how can i hide the drawer from signin screen and tuto screen ?

  • Does this answer your question? [how to hide drawer in react router flux?](https://stackoverflow.com/questions/60343846/how-to-hide-drawer-in-react-router-flux) – kenmistry Apr 02 '20 at 04:59

1 Answers1

0

I found the way to lock the drawer, and doing some changes works with your show lock/unlock variable. You need to separate the group of scenes with drawer locked and the other one (unlocked), something like that...

<RouterRedux backAndroidHandler={() => { }}>
    <Drawer
        hideNavBar
        open={false}
        key="drawer"
        contentComponent={SideBar}
        drawerWidth={300}
    // drawerLockMode={show ? 'locked-closed' : 'unlocked'}>
    >
        <Scene
            key="root" hideNavBar
            transitionConfig={transitionConfig}
            drawerLockMode='locked-closed'
        >
            <Scene key="Tuto" component={Tuto} type={ActionConst.RESET} />
            <Scene
                initial
                key="CheckAuth"
                component={CheckAuth}
                type={ActionConst.RESET}
            />
        </Scene>
        <Scene
            key="root2"
            hideNavBar
            transitionConfig={transitionConfig}
            drawerLockMode='unlocked'
        >
            {/*<Scene key="WIP" component={WorkInProgress} />*/}
            <Scene key="SignIn" component={SignIn} />
            <Scene key="ResetPassword" component={ResetPassword} />
            <Scene key="Visits" component={Visits} />
            <Scene key="VisitDetails" component={VisitDetails} />
            <Scene key="Statistiques" component={Statistiques} />
            <Scene key="Notification" component={Notification} />
            <Scene key="Sync" component={Sync} />
        </Scene>
    </Drawer>
</RouterRedux>
daaanigm
  • 126
  • 5