Skip to content

Commit

Permalink
feat: 채팅방 하단으로 내리기 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
yeoniii20 committed Sep 11, 2024
1 parent 056e19e commit e0c92cd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions screen/Chat/chatRoom3.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,12 @@ const ChatRoom3 = () => {
}, 100);
};

useEffect(() => {
if (receivedMessages.length > 0) {
scrollToEnd();
}
}, [receivedMessages]);

// 스크롤 업 이벤트 처리
const handleScroll = ({ nativeEvent }) => {
if (nativeEvent.contentOffset.y <= 0 && hasMoreMessages && !loading) {
Expand Down

0 comments on commit e0c92cd

Please sign in to comment.