Skip to content

Releases: thebuilder/react-intersection-observer

v10.0.0

28 Oct 15:02

Choose a tag to compare

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

  • @Akshay-Vs made their first contribution in #728
  • @Copilot made their first contribution in #731

Full Changelog: v9.16.0...v10.0.0

v9.16.0

05 Mar 20:47

Choose a tag to compare

What's Changed

Full Changelog: v9.15.1...v9.16.0

v9.15.1

21 Jan 11:06
27681db

Choose a tag to compare

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)

v9.15.0

14 Jan 09:50
f098c1e

Choose a tag to compare

9.15.0 (2025-01-14)

Features

  • restore beforeEach in test utils (788dd47)

v9.14.1

30 Dec 21:40
f3213dd

Choose a tag to compare

9.14.1 (2024-12-30)

Bug Fixes

  • ensure browser environment in test-utils (6e459f2)

v9.14.0

14 Dec 13:42
8bafe25

Choose a tag to compare

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.

v9.13.1

04 Sep 20:25
7c6939a

Choose a tag to compare

9.13.1 (2024-09-04)

Bug Fixes

  • align IntersectionObserver options with DOM API (abb4ee8)

v9.13.0

11 Jul 10:03
c9cef8f

Choose a tag to compare

9.13.0 (2024-07-11)

Features

v9.12.0

11 Jul 08:13
054adf4

Choose a tag to compare

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

v9.11.0

11 Jul 07:13
e3f8129

Choose a tag to compare

9.11.0 (2024-07-11)

Features

  • remove script to publish dist dir (0980efa)