I am using react navigation, and I have a start screen that checks if the user is authenticated.
If the user is already authenticated, then it navigates to the main screen of the app, otherwise the start screen shows some login options. This works perfectly in the expo client itself. However it fails for standalone apps (only tested Android so far).
All the AppLoading props are optional and navigating to the new screen renders a new component which should remove the splash screen. Why isnt this working?
Approximately my code:
componentDidMount(){
SecureStore.getItemAsync('MY_TOKEN').then((token) => {
if (token) {
this.props.authAndGoToMain({ token });
} else {
this.setState({ hideSplashScreen: true });
}
}, (err) => {
this.setState({ hideSplashScreen: true });
},
);
}
render(){
if(!this.state.hideSplashScreen){
return <AppLoading />
}
return <MyComponent />
}