我需要使用redux管理路由器,我具有“简单”的场景和“场景”选项卡,但是这些选项卡需要根据API进行显示。
我尝试过这样
router.js
createScenes = () => {
Actions.create(
<Scene tabs tabBarPosition="bottom" icon={TabIcon} showLabel={true} tabBarStyle={styles.Tabbar} hideNavBar activeTintColor="#3498db">
{
// this.props.user.permissions.length > 0 && (
// <Scene key="Jornada" component={Jornada} title="Jornada" hideNavBar />
// )
}
<Scene key="Search" component={Search} title="Procurar" hideNavBar />
<Scene key="Tracking" component={Tracking} title="Informar" hideNavBar />
<Scene key="Profile" component={Profile} title="Profile" hideNavBar />
</Scene>
)
}
render(){
return(
<Root>
<Router>
<Stack key="root">
<Scene key="Login" component={Login} title="Login" hideNavBar initial />
<Scene key="Senha" component={Senha} title="Senha" hideNavBar />
<Scene key="Cadastro" component={Cadastro} title="Cadastro" hideNavBar />
<Scene key="Choose" component={Choose} title="Choose" hideNavBar />
{ this.createScenes() }
<Scene key="Item" component={Item} title="Item" hideNavBar />
<Scene key="Baixar" component={Baixar} title="Baixar" hideNavBar />
<Scene key="Informar" component={Informar} title="Informar" hideNavBar />
<Scene key="Coleta" component={Coleta} title="Coleta" hideNavBar />
</Stack>
</Router>
</Root>
)
}
}
我的想法是我有路由(没有标签栏),并且我的用户登录了,取决于他们的用户级别,我有一些选项卡,而有些没有