Validate on submit
This commit is contained in:
parent
f0803ca6ec
commit
0c61c431f0
|
@ -12,11 +12,8 @@ const Login = () => {
|
||||||
email: '',
|
email: '',
|
||||||
password: '',
|
password: '',
|
||||||
},
|
},
|
||||||
onSubmit: async ({ value }) => {
|
|
||||||
console.log({ value });
|
|
||||||
},
|
|
||||||
validators: {
|
validators: {
|
||||||
onChange: yup.object({
|
onSubmit: yup.object({
|
||||||
email: yup.string().label('Email').email().required(),
|
email: yup.string().label('Email').email().required(),
|
||||||
password: yup.string().label('Password').min(8).max(256).required(),
|
password: yup.string().label('Password').min(8).max(256).required(),
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Reference in New Issue