Skip to content

Instantly share code, notes, and snippets.

@tcodes0
Last active April 20, 2020 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tcodes0/e84632fa2f5affb6111f8457779a14b7 to your computer and use it in GitHub Desktop.
Save tcodes0/e84632fa2f5affb6111f8457779a14b7 to your computer and use it in GitHub Desktop.
async-await react-native 2
/**
* react-native project
*/
class HeartButton extends Component<Props, State> {
handlePress = async e => {
const { data } = await apolloMutation1({
variables
})
navigation.navigate('ChatScreen', { conversationId: data.conversation.id })
apolloMutatation2({
variables
})
// no .catch
}
render() {
return <Button onPress={this.handlePress} loading={saving} />
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment