skip to Main Content

Javascript – Scroll event listener function gets triggered as many as how far I scrolled

const handleReadChat = useCallback(() => { const entry = refEntries.current; if ( entry.scrollTop > entry.scrollHeight - 800 && activeRoom && conversations?.content?.length > 0 && activeRoom.unread ) { setTimeout(() => { dispatch(readConversationByRoom(activeRoom.id)); console.log("executed", activeRoom.unread); }, 3000); } }, [activeRoom, conversations?.content]); useEffect(()…

VIEW QUESTION
Back To Top
Search