From 321c08f74403423579cd9ca855a528122061698c Mon Sep 17 00:00:00 2001 From: jhj2713 Date: Thu, 1 Aug 2024 15:27:39 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=A0=8C=EB=8D=94=EB=A7=81=20=EB=81=9D?= =?UTF-8?q?=EB=82=9C=20=ED=9B=84=20=EC=8A=A4=ED=81=AC=EB=A1=A4=20=EB=B0=A9?= =?UTF-8?q?=EC=A7=80=20=20=EC=BD=94=EB=93=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/hooks/usePopup.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/src/hooks/usePopup.tsx b/client/src/hooks/usePopup.tsx index 054373eb..790fbee5 100644 --- a/client/src/hooks/usePopup.tsx +++ b/client/src/hooks/usePopup.tsx @@ -9,10 +9,10 @@ export default function usePopup({ const [isVisible, setIsVisible] = useState(false); useEffect(() => { - if (!isVisible) { + return () => { document.body.style.overflow = "unset"; - } - }, [isVisible]); + }; + }, []); const handleOpenPopup = () => { document.body.style.overflow = "hidden"; @@ -20,6 +20,7 @@ export default function usePopup({ }; const handleClosePopup = () => { + document.body.style.overflow = "unset"; handlePhoneNumberChange(""); setIsVisible(false); };