aksonov / aksonov/react-native-tabs

create if else in ROOT scene for choose tabs component

未關閉
#63 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
JavaScript
星號
727
分支
112
PR 合併指標
30 天內沒有已合併 PR

描述

Hi

im have 2 costum tabs for user & admin. so after user login, the router flux will display tabs by catagory. im try to put if else in my root scene, but no work.

```
class RootRouter extends React.Component{

constructor(props){
super(props)
this.state = {
userId : '',
userStatus:''
}
}

componentDidMount () {
AsyncStorage.getItem("status")
.then(res => JSON.parse(res))
.then(data => this.setState({
userStatus : data
}))
.catch(err => console.log(err))
}

render () {
return (



{

this.state.userStatus === 0
// IF ADMIN LOGIN
? (



)
// IF USER LOGIN
: (




)
}


);
}

}

export default RootRouter;
```
im try to refresh root screne with Actions.tab_feed({refresh: true}) , but still not work.
Please anyone idea to solve this? Thanks

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。