aksonov / aksonov/react-native-tabs

create if else in ROOT scene for choose tabs component

Offen
#63 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
727
Forks
112
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.