Javascript 如何使用Redux React本地路由器流量管理路由器
我需要用redux管理我的路由器,我有“简单”的场景和场景选项卡,但是这些选项卡需要根据API显示 我试过这样做 路由器.jsJavascript 如何使用Redux React本地路由器流量管理路由器,javascript,react-native,Javascript,React Native,我需要用redux管理我的路由器,我有“简单”的场景和场景选项卡,但是这些选项卡需要根据API显示 我试过这样做 路由器.js createScenes = () => { Actions.create( <Scene tabs tabBarPosition="bottom" icon={TabIcon} showLabel={true} tabBarStyle={styles.Tabbar} hideNavBar activeTintColo
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>
)
}
}
createScenes=()=>{
动作。创建(
{
//this.props.user.permissions.length>0&&(
//
// )
}
)
}
render(){
返回(
{this.createScenes()}
)
}
}
我的想法是,我有路由(没有tabbar),我的用户登录,这取决于他们的用户级别,我有一些选项卡,有些没有