github thebuilder/react-intersection-observer v6.4.0
Intersection Ratio

latest releases: v10.0.0, v9.16.0, v9.15.1...
6 years ago

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

Don't miss a new react-intersection-observer release

NewReleases is sending notifications on new releases.