404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.133.116.59: ~ $
import { useState, useEffect } from "react"

const useWindowScrollPosition = ({distance = 0}) => {

    const [scrollPosition, setScrollPosition] = useState(window.pageYOffset)

    useEffect(() => {
        const handleScroll = () => {
            setScrollPosition(window.pageYOffset)
        }

        window.addEventListener("scroll", handleScroll)

        return () => window.removeEventListener("scroll", handleScroll)
    }, [])

    return scrollPosition >= distance;
}

export default useWindowScrollPosition

Filemanager

Name Type Size Permission Actions
useHasScrolled.ts File 540 B 0644
useSectionInView.ts File 671 B 0644