MCPcopy Create free account
hub / github.com/devs-in-tech/DevsInTech / handleScroll

Function handleScroll

src/components/ScrollToTop.jsx:17–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15 useEffect(() => {
16 smoothscroll.polyfill(); // Apply smoothscroll polyfill for older browsers
17 const handleScroll = () => {
18 let height = 580;
19 const scrollCheck =
20 document.documentElement.scrollTop ||
21 document.body.scrollTop;
22 if (scrollCheck > height) {
23 setScroll(true);
24 } else {
25 setScroll(false);
26 }
27 };
28 window.addEventListener("scroll", handleScroll);
29 return () => {
30 window.removeEventListener("scroll", handleScroll);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected