NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #4196 most downloaded on npm
Monitor if a component is inside the viewport, using IntersectionObserver API
Last release 1 months ago
26 Aug 2026
Release timing varies
gaps range from 2 weeks to 8 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
171 releases · first in 2017
Nothing published for this version
This release just removes the deprecation flag. You don't need to change anything.
Due to popular demand (#91), I'll keep support for rendering plain children inside the <Observer />.
This release just removes the deprecation flag. You don't need to change anything.
They will still work for now, but you'll get a deprecation warning unless NODE_ENV is production.
Looking at how i'm currently using react-intersection-observer, and how render props have been adapted by React, this release moves all rendering to to the children prop.
The way to use the component is to forward the ref to your outer element, giving you full control over the DOM.
import Observer from 'react-intersection-observer'
const Component = () => (
<Observer>
{({ inView, ref }) => (
<div ref={ref}>
<h2>{`Header inside viewport ${inView}.`}</h2>
</div>
)}
</Observer>
)
export default Component
renderproptag propchild as React.NodeThey will still work for now, but you'll get a deprecation warning unless NODE_ENV is production.
If you are currently using render, you can move the method directly to children.
One column per quarter.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Switch the build system to Rollup, so the package now contains an umd, CommonJS and ES optimized build. 🎉
Switch the build system to Rollup, so the package now contains an umd, CommonJS and ES optimized build. 🎉
This shouldn't change anything if you are already using the package, but if you imported the files in dist directly then that won't work anymore
Nothing published for this version
No more wrapping div element! render now gives complete control over the rendering, making it easier to use while keeping HTML semantic
No more wrapping div element! render now gives complete control over the rendering, making it easier to use while keeping HTML semantic
import Observer from 'react-intersection-observer'
const Component = () => (
<Observer
render={({ inView, ref }) => (
<div ref={ref}>
<h2>{`Header inside viewport ${inView}.`}</h2>
</div>
)}
/>
)
export default Component
innerRefrender callback argumentsThis release breaks the render prop, so it differs from the child as function method.
If you used the render method before, and you were happy with, you can move the function to children.
Otherwise, you'll need to handle the new ref and assign it to a HTMLElement.
Old way
<Observer render={inView => <h2>Inview {inView}</h2>} />
New way
<Observer render={({inView, ref}) => <div ref=ref><h2>Inview {inView}</h2></div>} />
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
The render prop pattern recently became a popular replacement for the child as function pattern.
The render prop pattern recently became a popular replacement for the child as function pattern.
Previously the render prop on react-intersection-observer, was handled differently from children so it only rendered when the element was inside the viewport.
If you were using the render prop before, you need to handle when to render the content.
Old way
<Observer render={() => <div>Only rendered when in viewport</div>} />
New way
<Observer render={inView => inView ? <div>Only rendered when in viewport</div> : null} />
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Thanks to @Kovensky for correcting the definitions.
Thanks to @Kovensky for correcting the definitions.
Nothing published for this version
Switched to using Flow to type check all the code. There shouldn't be any breaking changes, but there has been some internal bug fixes that was caught…
Switched to using Flow to type check all the code. There shouldn't be any breaking changes, but there has been some internal bug fixes that was caught after enabling Flow.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Added support for all the IntersectionObserver options! 🎉
Added support for all the IntersectionObserver options! 🎉
This closes #18
Nothing published for this version
Nothing published for this version
Removed the Intersection Observer polyfill - You need to add it manually to your project.
Removed the Intersection Observer polyfill - You need to add it manually to your project.
Fixes: #10
Fix #8 - Merge usage of isIntersecting with intersectionRatio.
Fix #8 - Merge usage of isIntersecting with intersectionRatio.
Removed debugging console.log
Removed debugging console.log
Nothing published for this version
Fixes #7 by removing usage of isIntersecting
Fixes #7 by removing usage of isIntersecting
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →