From 0c61c431f09f13a9f5d975aeab683cb50ab43661 Mon Sep 17 00:00:00 2001 From: Pijus Kamandulis Date: Mon, 21 Oct 2024 22:33:50 +0300 Subject: [PATCH] Validate on submit --- src/pages/Login.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/pages/Login.tsx b/src/pages/Login.tsx index ce9d99b..f127424 100644 --- a/src/pages/Login.tsx +++ b/src/pages/Login.tsx @@ -12,11 +12,8 @@ const Login = () => { email: '', password: '', }, - onSubmit: async ({ value }) => { - console.log({ value }); - }, validators: { - onChange: yup.object({ + onSubmit: yup.object({ email: yup.string().label('Email').email().required(), password: yup.string().label('Password').min(8).max(256).required(), }),