From 39b6f27f40c8b5cf1dc9867bdd2b88090b61212f Mon Sep 17 00:00:00 2001 From: 78-artilleryman Date: Sun, 7 Apr 2024 19:47:18 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EB=88=88=20=EB=AA=A8=EC=96=91=20?= =?UTF-8?q?=EC=95=84=EC=9D=B4=EC=BD=98=20=EB=88=84=EB=A5=B4=EB=A9=B4=20?= =?UTF-8?q?=EB=B9=84=EB=B0=80=EB=B2=88=ED=98=B8=20=EB=B3=B4=EC=9D=B4?= =?UTF-8?q?=EA=B2=8C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/signinPage/Input.tsx | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/components/signinPage/Input.tsx b/src/components/signinPage/Input.tsx index de82a25c1..f2961800b 100644 --- a/src/components/signinPage/Input.tsx +++ b/src/components/signinPage/Input.tsx @@ -64,19 +64,10 @@ function Input({ validation, }: InputProps) { const [pwState, setPwState] = useState(false); - const passwordRef = useRef(null); const error = errors[id]; const toggleEyesButton = () => { - if (passwordRef.current) { - if (pwState) { - passwordRef.current.type = "text"; - setPwState(false); - } else { - passwordRef.current.type = "password"; - setPwState(true); - } - } + setPwState((prev) => !prev); }; return ( @@ -85,7 +76,7 @@ function Input({ {pwState ? ( - Pw-off - ) : ( Pw-on + ) : ( + Pw-off )} )}