From bd39293326553d5b5d1992b9579475cfea07fa2e Mon Sep 17 00:00:00 2001 From: seunghwan Date: Sun, 3 Dec 2023 15:44:39 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EB=AC=B4=ED=95=9C=20=EC=8A=A4?= =?UTF-8?q?=ED=81=AC=EB=A1=A4=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EA=B0=80?= =?UTF-8?q?=EC=A0=B8=EC=98=A4=EB=8A=94=20useEffect=20=EC=BD=94=EB=93=9C?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/auction/[slug]/page.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/app/auction/[slug]/page.tsx b/src/app/auction/[slug]/page.tsx index f947e89..0db03a2 100644 --- a/src/app/auction/[slug]/page.tsx +++ b/src/app/auction/[slug]/page.tsx @@ -44,12 +44,10 @@ export default function AuctionDetail({ }, [data]); useEffect(() => { - if (comment && Array.isArray(comment) && Array.isArray(addCommnet)) { - setComment((pre: CommentType[]) => { - return [...pre, ...addCommnet]; - }); + if (comment && addCommnet) { + setComment([...comment, ...addCommnet]); } - }, [addCommnet]); + }, [addCommnet, refetchScroll]); if (isPending) { return ;