Created
January 11, 2021 17:39
-
-
Save polluterofminds/ca228791a7139167c3b92e358a3750f9 to your computer and use it in GitHub Desktop.
handleSubmit
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
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