From 63276541a2853dfae99eec1a201fc6f423ab87a2 Mon Sep 17 00:00:00 2001 From: lydiacho <81505421+lydiacho@users.noreply.github.com> Date: Wed, 31 Jul 2024 11:37:51 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20useEffect=EB=A1=9C=20=EA=B0=90=EC=8B=B8?= =?UTF-8?q?=EC=A3=BC=EA=B8=B0=20(#327)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 5fcbe0b8..0c02a8ee 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -43,11 +43,13 @@ const router = createBrowserRouter([ ]); const App = () => { - const isMobile = /Mobi/i.test(window.navigator.userAgent); - if (isMobile) { - alert('PC로 지원해주세요.'); - window.location.href = 'https://makers.sopt.org/recruit'; - } + useEffect(() => { + const isMobile = /Mobi/i.test(window.navigator.userAgent); + if (isMobile) { + alert('PC로 지원해주세요.'); + window.location.href = 'https://makers.sopt.org/recruit'; + } + }, []); const sessionRef = useRef(null);