Created
April 25, 2020 15:20
-
-
Save joaovitorzv/9becc856a0d2a6e435658fab2b538502 to your computer and use it in GitHub Desktop.
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
export default function Register() { | |
const emailsAlreadyInUse = []; | |
function handleSubmit(values, { | |
setSubmitting, | |
setFieldError | |
}) { | |
setTimeout(() => { | |
if (values.email === 'teste123@teste.com') { | |
setFieldError('email', 'email already registered'); | |
emailsAlreadyInUse.push(values.email); | |
setSubmitting(false); | |
} else { | |
alert(JSON.stringify(values)) | |
setSubmitting(false); | |
} | |
}, 100); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment