From 272de77e217f99c978f096812499da08906421c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=95=9C=EA=B7=9C=EC=A7=84?= Date: Mon, 12 Sep 2022 00:13:30 +0900 Subject: [PATCH] feat : for demo --- src/hooks/useInput.tsx | 2 +- src/pages/auth/Login.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hooks/useInput.tsx b/src/hooks/useInput.tsx index 3038920..392e8c6 100644 --- a/src/hooks/useInput.tsx +++ b/src/hooks/useInput.tsx @@ -21,7 +21,7 @@ const useInput = (initialValue: T) => { }, }; - return [value, bind, reset] as const; + return [value, bind, reset, setValue] as const; }; export default useInput; diff --git a/src/pages/auth/Login.tsx b/src/pages/auth/Login.tsx index df1d952..d09fbec 100644 --- a/src/pages/auth/Login.tsx +++ b/src/pages/auth/Login.tsx @@ -19,7 +19,8 @@ const Login = () => { const navigate = useNavigate(); const { step } = useParams(); const [valueSend, bindSend, resetSend] = useInput(''); - const [valueValidate, bindValidate, resetValidate] = useInput(''); + const [valueValidate, bindValidate, resetValidate, setValueValidate] = + useInput(''); const [auth, setAuth] = useRecoilState(authState); const redirectUri = useRecoilValue(redirectState); const { openModal, closeModal } = useModal(); @@ -44,6 +45,7 @@ const Login = () => { phoneNumber: data.data.phoneNumber, }); resetSend(); + setValueValidate(data.data.validationNumber); }, onError: () => navigate('/auth/login/1'), },