Last active
January 6, 2019 14:04
-
-
Save krizzu/20cd8b5f2970378679410dee00b11117 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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