New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-scroll-edge

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-scroll-edge

Check if scroll is within an offset to the start or end

latest
Source
npmnpm
Version
1.0.30
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

react-scroll-edge

Check if scroll is within an offset to the start or end

Example

npm install react-scroll-edge or yarn add react-scroll-edge

function Example() {
    const ref = useRef(null);
    const { start, end } = useScrollEdge(ref, "horizontal", 100);

    return (
        <ul ref={ref}>...</ul>
    )
}

The return object contains ´start´ and ´end´ booleans which are true if the scroll distance is withing the providded offset to the start/beginning.

Function type

useScrollEdge(
    element: RefObject<HTMLElement>,
    orientation: "horizontal" | "vertical",
    offset?: number = 0
): { start: boolean, end: boolean };

FAQs

Package last updated on 21 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts