aksonov / aksonov/react-native-tabs
create if else in ROOT scene for choose tabs component
- Ngôn ngữ chính
- JavaScript
- Star
- 727
- Fork
- 112
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.