Intersection Ratio
This release exposes the intersectionRatio
, giving you a bit more insight into what triggered an update.
import { InView } from 'react-intersection-observer'
const Component = () => (
<InView>
{({ inView, ref, intersectionRatio }) => (
<div ref={ref}>
<h2>{`Header inside viewport ${inView} at ${intersectionRatio}`}</h2>
</div>
)}
</InView>
)
export default Component
See #123