thebuilder/react-intersection-observer
 Watch   
 Star   
 Fork   
2025-10-28 22:50:49
react-intersection-observer

v10.0.0

Based on the great work in #718 by @jantimon - This release adds the new useOnInView hook.

✨ New

  • useOnInView hook — a no-re-render alternative to useInView that delivers (inView, entry) to your callback while returning a ref you can attach to any element. Designed for tracking, analytics, and other side effect heavy workloads where state updates are unnecessary.
  • IntersectionChangeEffect / IntersectionEffectOptions types — exported helper types that describe the new hook’s callback and options surface.
  • Storybook playground + documentation — new story, README section, and JSDoc example demonstrating how to use useOnInView.

⚠️ Breaking Changes

  • useInView, useOnInView, and <InView> now ignore the browser’s initial inView === false emission for onChange events, so handlers only fire once a real visibility change occurs, while still reporting all subsequent enter/leave transitions.

🧪 Testing

  • Added a dedicated Vitest suite for useOnInView, covering thresholds, triggerOnce, skip toggling, merged refs, and multiple observers on the same node.

What's Changed

New Contributors

Full Changelog: https://github.com/thebuilder/react-intersection-observer/compare/v9.16.0...v10.0.0

2025-03-06 04:43:03
react-intersection-observer
2025-01-21 19:05:40
react-intersection-observer

v9.15.1

9.15.1 (2025-01-21)

Bug Fixes

Fixes and improvements to react-intersection-observer/test-utils

  • always recreate the IntersectionObserver mock (c720914)
  • improve test lib detection (1858e43)
  • use isMockFunction to detect if the IntersectionObserver is being mocked (189133f)
2025-01-14 17:49:15
react-intersection-observer

v9.15.0

9.15.0 (2025-01-14)

Features

  • restore beforeEach in test utils (788dd47)
2024-12-31 05:39:25
react-intersection-observer

v9.14.1

9.14.1 (2024-12-30)

Bug Fixes

  • ensure browser environment in test-utils (6e459f2)
2024-12-14 21:41:12
react-intersection-observer

v9.14.0

9.14.0 (2024-12-14)

Features

  • support React 19 (8bafe25)
  • Drop support for React 15/16. The types are no longer compatible with later version of React, since they have dropped the deprecated types.
2024-09-05 04:24:08
react-intersection-observer

v9.13.1

9.13.1 (2024-09-04)

Bug Fixes

  • align IntersectionObserver options with DOM API (abb4ee8)
2024-07-11 18:02:30
react-intersection-observer

v9.13.0

9.13.0 (2024-07-11)

Features

  • fix package exports and simplify build (#695) (c9cef8f) - All thanks go to @RobinTail
2024-07-11 16:12:36
react-intersection-observer

v9.12.0

9.12.0 (2024-07-11)

Features

  • upgrade to Vitest 2 (#690) (054adf4)
    • Upgrade to Vitest 2
    • Add basic browser mode test, that runs with an unmocked IntersectionObserver
    • Types cleanup in test-utils, getting rid of @types/jest (replaced with vitest)
    • Move test mocking setup from beforeEach to beforeAll
2024-07-11 15:12:39
react-intersection-observer

v9.11.0

9.11.0 (2024-07-11)

Features

  • remove script to publish dist dir (0980efa)