我无法在启动场景中禁用抽屉并在主场景中启用它。 如果我将抽屉锁在以下场景中:
<Scene key="scenes" hideNavBar drawerLockMode='locked-closed'>
它将被锁定在所有场景中。
另一个问题是,如果我移除<Scene key="scenes" hideNavBar >
抽屉将正常工作,但在主场景中键入=“ replace”将引发错误。
这是我的代码:
<Router>
<Drawer
hideNavBar
key="drawer"
onExit={() => {
console.log('Drawer closed');
}}
onEnter={() => {
console.log('Drawer opened');
}}
contentComponent={DrawerMenu}
drawerWidth={300}
>
<Scene key="scenes" hideNavBar >
<Scene key="initiate" drawerLockMode='locked-closed' >
<Scene key="Login" component={LoginForm} title="Log in" hideNavBar />
<Scene key="Signup" component={SignupForm} title="Signup" locked-closed hideNavBar />
<Scene key="Welcome" component={WelcomePage} title="Welcome" locked-closed initial hideNavBar />
</Scene>
<Scene key="main" type="replace" drawerLockMode='unlocked' >
<Scene key="Games" component={ReceiptPage} title="Games" initial hideNavBar />
<Scene key="Profile" component={Profile} title="Profile" hideNavBar />
<Scene key="Tickets" component={TicketDetails} title="Tickets" hideNavBar />
</Scene>
</Scene>
</Drawer>
</Router>