MCPcopy Create free account
hub / github.com/DavidHDev/react-bits / handleScroll

Function handleScroll

src/components/navs/Sidebar.jsx:78–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

76 if (!el) return;
77
78 const handleScroll = () => {
79 const { scrollTop, scrollHeight, clientHeight } = el;
80 setIsScrolledToBottom(scrollTop + clientHeight >= scrollHeight - 10);
81 };
82
83 el.addEventListener('scroll', handleScroll);
84 handleScroll();

Callers 1

useScrolledToBottomFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected