aksonov / aksonov/react-native-tabs

create if else in ROOT scene for choose tabs component

Open
#63 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
727
Forks
112
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.