Skip to content

denise-schaefer/useIntersection

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

Watchers

Forks

Releases

No releases published

Packages

No packages published