We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7254bd1 commit e5423c6Copy full SHA for e5423c6
src/domains/recommend/hook/useChatScroll.ts
@@ -22,10 +22,12 @@ export const useChatScroll = (lastMessageId: string) => {
22
return;
23
}
24
25
- requestAnimationFrame(() => {
+ const frameId = requestAnimationFrame(() => {
26
chatEndRef.current?.scrollIntoView({ behavior: 'auto' });
27
setShowNewMessageAlert(false);
28
});
29
+
30
+ return () => cancelAnimationFrame(frameId);
31
}, [lastMessageId]);
32
33
// 스크롤 제일 아래로
0 commit comments