我在索引页面中创建了一个抽屉,以便在应用程序启动时加载。现在注销和登录时我想更新抽屉里的菜单。有什么办法吗?
<DrawerLayoutAndroid
drawerWidth={300}
drawerPosition={DrawerLayoutAndroid.positions.Left}
renderNavigationView={() => {
if (drawer && navigator) {
return navView;
}
return null;
}}
ref={(drawer) => { !this.state.drawer ? this.setDrawer(drawer) : null }}
>
{drawer &&
<Navigator
initialRoute={Navigate.getInitialRoute()}
navigationBar={<Toolbar onIconPress={drawer.openDrawer} />}
configureScene={() => {
return Navigator.SceneConfigs.FadeAndroid;
}}
ref={(navigator) => { !this.state.navigator ? this.setNavigator(navigator) : null }}
renderScene={(route) => {
if (this.state.navigator && route.component) {
return (
<View
style={styles.scene}
showsVerticalScrollIndicator={false}>
<route.component title={route.title} path={route.path} {...route.props} />
</View>
);
}
}}
/>
}
</DrawerLayoutAndroid>