Skip to content

Repository files navigation

useIntersection hook

This project is a custom hook for React that uses the IntersectionObserver API to observe a DOM element.

When to use useIntersection and useIntersectionRef?

useIntersection

classical useIntersection hook with useEffect and useRef

useIntersectingRef

same as useIntersection but with avoiding the need to use useEffect and useRef, allows intersection on optional or delayed elements

Getting Started

Prerequisites

  • Node.js
  • pnpm

Installing

pnpm i

Running the tests

pnpm test

Building

pnpm build

Built With

About

react hook using intersection observer

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages