Releases: thebuilder/react-intersection-observer
Releases · thebuilder/react-intersection-observer
v10.0.0
Based on the great work in #718 by @jantimon - This release adds the new useOnInView hook.
✨ New
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.
⚠️ Breaking Changes
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.
🧪 Testing
- Added a dedicated Vitest suite for
useOnInView, covering thresholds,triggerOnce,skiptoggling, merged refs, and multiple observers on the same node.
What's Changed
- chore: update package url in package.json by @thebuilder in #721
- build(deps-dev): bump vite from 6.2.0 to 6.2.5 by @dependabot[bot] in #724
- build(deps-dev): bump vite from 6.2.5 to 6.2.7 by @dependabot[bot] in #727
- Fix minor grammatical issue in documentation intro by @Akshay-Vs in #728
- Remove bundlephobia badge from README by @Copilot in #731
- Update dependencies by @thebuilder in #737
- feat: implement the useOnInView hook by @thebuilder in #738
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
What's Changed
- ci: drop semantic release flow by @thebuilder in #719
- Correctly detect global testing framework by @thebuilder in #720
Full Changelog: v9.15.1...v9.16.0
v9.15.1
v9.15.0
v9.14.1
v9.14.0
v9.13.1
v9.13.0
9.13.0 (2024-07-11)
Features
- fix package exports and simplify build (#695) (c9cef8f) - All thanks go to @RobinTail