Skip to content

Instantly share code, notes, and snippets.

@krizzu
Last active January 6, 2019 14:04
Show Gist options
  • Save krizzu/20cd8b5f2970378679410dee00b11117 to your computer and use it in GitHub Desktop.
Save krizzu/20cd8b5f2970378679410dee00b11117 to your computer and use it in GitHub Desktop.
// All necessary imports
class AppAuthScreen extends Component {
async componentDidMount() {
const { navigation } = this.props;
const currentEmail = await AsyncStorage.getItem(
'@footballApp:currentEmail' // key used to save email during user singup
);
// if email value exists, it means that it's returning user, so take him to login page
navigation.navigate(currentEmail ? 'LoginScreen' : 'SignUpNavigator');
}
render() {
return (
<View style={styles.container}>
<ActivityIndicator size="large" />
</View>
);
}
}
export default AppAuthScreen;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment