<Formik
onSubmit = {(values, { setSubmitting }) => {(
setTimeout(() => {
console.log('Putted: ', values)
}, 500))
}}
>
{
({ values, touched, errors, isValid,
handleBlur, isSubmitting,
handleChange, handleSubmit }) => (
<Form autoComplete="off"
method="POST" action="https://localhost:5001/auth/register"
onSubmit={ handleSubmit }>
<label htmlFor="email">Email</label>
<Field
id="email"
name="email"
type="email"
onBlur={ handleBlur }
value={ values.email }
placeholder="Your email"
onChange={ handleChange }
className={errors.email && touched.email && "error"}
/>
{
errors.email && touched.email && (
<div className="input-feedback">
{errors.email}
</div>
)
}
<button type="submit" className="button foreground center medium-space-top">Send message</button>
</Form>
)
}
</Formik>