From 18490d0da4a3448f1ca073cbf3b5557566955d5e Mon Sep 17 00:00:00 2001 From: Ssoco Date: Sun, 16 Jun 2024 09:26:36 +0900 Subject: [PATCH] =?UTF-8?q?:bug:=20=EC=8B=9C=EA=B3=84=20=ED=83=AD=EC=97=90?= =?UTF-8?q?=EC=84=9C=200=EC=9C=BC=EB=A1=9C=20=EC=B4=88=EA=B8=B0=ED=99=94?= =?UTF-8?q?=EB=90=9C=20=EC=8B=9C=EA=B0=84=EC=9D=B4=20=EC=9E=A0=EA=B9=90=20?= =?UTF-8?q?=EB=B3=B4=EC=97=AC=EC=A7=80=EB=8A=94=20=ED=98=84=EC=83=81?= =?UTF-8?q?=EC=9D=84=20=EC=A0=9C=EA=B1=B0=ED=95=98=EA=B8=B0=20=EC=9C=84?= =?UTF-8?q?=ED=95=B4=20useEffect=EB=A5=BC=20useLayoutEffect=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useClock.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/useClock.tsx b/src/hooks/useClock.tsx index afdd184..edb1cb7 100644 --- a/src/hooks/useClock.tsx +++ b/src/hooks/useClock.tsx @@ -1,4 +1,4 @@ -import { useEffect } from "react"; +import { useLayoutEffect } from "react"; import useTimeManage from "./utils/useTimeManage"; import { useSelector } from "react-redux"; import { RootState } from "@src/store"; @@ -7,7 +7,7 @@ const useClock = () => { const { time, setTime, playTimeout } = useTimeManage(); const { hour12 } = useSelector((state: RootState) => state.clockReducer); - useEffect(() => { + useLayoutEffect(() => { const now = new Date(Date.now()); playTimeout.current = setTimeout(() => { setTime({