v10.0.0
Based on the great work in #718 by @jantimon - This release adds the new useOnInView hook.
useOnInViewhook — a no-re-render alternative touseInViewthat 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/IntersectionEffectOptionstypes — 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.
useInView,useOnInView, and<InView>now ignore the browser’s initialinView === falseemission foronChangeevents, so handlers only fire once a real visibility change occurs, while still reporting all subsequent enter/leave transitions.
- Added a dedicated Vitest suite for
useOnInView, covering thresholds,triggerOnce,skiptoggling, merged refs, and multiple observers on the same node.
- chore: update package url in package.json by @thebuilder in https://github.com/thebuilder/react-intersection-observer/pull/721
- build(deps-dev): bump vite from 6.2.0 to 6.2.5 by @dependabot[bot] in https://github.com/thebuilder/react-intersection-observer/pull/724
- build(deps-dev): bump vite from 6.2.5 to 6.2.7 by @dependabot[bot] in https://github.com/thebuilder/react-intersection-observer/pull/727
- Fix minor grammatical issue in documentation intro by @Akshay-Vs in https://github.com/thebuilder/react-intersection-observer/pull/728
- Remove bundlephobia badge from README by @Copilot in https://github.com/thebuilder/react-intersection-observer/pull/731
- Update dependencies by @thebuilder in https://github.com/thebuilder/react-intersection-observer/pull/737
- feat: implement the useOnInView hook by @thebuilder in https://github.com/thebuilder/react-intersection-observer/pull/738
- @Akshay-Vs made their first contribution in https://github.com/thebuilder/react-intersection-observer/pull/728
- @Copilot made their first contribution in https://github.com/thebuilder/react-intersection-observer/pull/731
Full Changelog: https://github.com/thebuilder/react-intersection-observer/compare/v9.16.0...v10.0.0
v9.16.0
- ci: drop semantic release flow by @thebuilder in https://github.com/thebuilder/react-intersection-observer/pull/719
- Correctly detect global testing framework by @thebuilder in https://github.com/thebuilder/react-intersection-observer/pull/720
Full Changelog: https://github.com/thebuilder/react-intersection-observer/compare/v9.15.1...v9.16.0