screenA
const DEMO_TOKEN = await AsyncStorage.getItem('id_token');
if (DEMO_TOKEN === null) {
this.props.navigation.navigate('screenB', {
onGoBack: () => this.refresh(),
});
return -3;
} else {
this.doSomething();
}
refresh() {
this.doSomething();
}
screenB
await AsyncStorage.setItem('id_token', myId);
this.props.navigation.state.params.onGoBack();
this.props.navigation.goBack();