From e0c92cd529c5a0f8d5b641da6c3c994d354228da Mon Sep 17 00:00:00 2001 From: yeoniii20 Date: Wed, 11 Sep 2024 22:42:28 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=B1=84=ED=8C=85=EB=B0=A9=20=ED=95=98?= =?UTF-8?q?=EB=8B=A8=EC=9C=BC=EB=A1=9C=20=EB=82=B4=EB=A6=AC=EA=B8=B0=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- screen/Chat/chatRoom3.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/screen/Chat/chatRoom3.jsx b/screen/Chat/chatRoom3.jsx index 17a069b..ba6e1e1 100644 --- a/screen/Chat/chatRoom3.jsx +++ b/screen/Chat/chatRoom3.jsx @@ -259,6 +259,12 @@ const ChatRoom3 = () => { }, 100); }; + useEffect(() => { + if (receivedMessages.length > 0) { + scrollToEnd(); + } + }, [receivedMessages]); + // 스크롤 업 이벤트 처리 const handleScroll = ({ nativeEvent }) => { if (nativeEvent.contentOffset.y <= 0 && hasMoreMessages && !loading) {