Last active
April 20, 2020 18:15
-
-
Save tcodes0/e84632fa2f5affb6111f8457779a14b7 to your computer and use it in GitHub Desktop.
async-await react-native 2
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
/** | |
* 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