Skip to content

Instantly share code, notes, and snippets.

@polluterofminds
Created January 11, 2021 17:39
Show Gist options
  • Save polluterofminds/ca228791a7139167c3b92e358a3750f9 to your computer and use it in GitHub Desktop.
Save polluterofminds/ca228791a7139167c3b92e358a3750f9 to your computer and use it in GitHub Desktop.
handleSubmit
const handleSubscribe = async (e) => {
e.preventDefault();
try {
await subscribe(email);
setSuccessMessage("Check your email to continue!");
setEmail("");
} catch (error) {
setError(error.message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment