From d9a6aefc0e32e226fe82d325e3ac9dd76fbdc433 Mon Sep 17 00:00:00 2001 From: Masaya Tojo Date: Mon, 7 Oct 2024 00:00:34 +0900 Subject: signUpForm1: tel3 のバリデーションを tel1, tel2 で発火させる MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SignUpForm1.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/SignUpForm1.tsx b/src/SignUpForm1.tsx index 4be29e9..9e17bef 100644 --- a/src/SignUpForm1.tsx +++ b/src/SignUpForm1.tsx @@ -5,7 +5,7 @@ import { useNavigate } from 'react-router-dom'; import { Form1Data, form1Schema } from './signUpSchema' export const SignUpForm1 = () => { - const { register, handleSubmit, formState: { errors } } = useForm({ + const { register, handleSubmit, formState: { errors }, trigger } = useForm({ resolver: zodResolver(form1Schema), }); const navigate = useNavigate(); @@ -31,8 +31,8 @@ export const SignUpForm1 = () => {
- - - - + trigger('tel3') })}>- + trigger('tel3') })}>-
{errors.tel3?.message}
-- cgit v1.2.3