Validate on submit

This commit is contained in:
Pijus Kamandulis 2024-10-21 22:33:50 +03:00
parent f0803ca6ec
commit 0c61c431f0
1 changed files with 1 additions and 4 deletions

View File

@ -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(),
}), }),