Skip to content

Instantly share code, notes, and snippets.

@fdjones
Created August 29, 2018 21:53
Show Gist options
  • Save fdjones/3b827f627c05a29df0d6c1d00186fc3c to your computer and use it in GitHub Desktop.
Save fdjones/3b827f627c05a29df0d6c1d00186fc3c to your computer and use it in GitHub Desktop.
async handleClick() {
try {
const res = await axios.get(
"https://em1p285uhk.execute-api.us-east-2.amazonaws.com/default/BloodyLambda"
);
this.setState({
firstName: res.data.firstName,
lastName: res.data.lastName
});
} catch (err) {
console.log(`Error: ${err}`);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment