Permalink
Fetching contributors…
Cannot retrieve contributors at this time
18 lines (11 sloc) 327 Bytes

ScrollSensor

FaCC that re-renders on when scroll position in a DOM element changes.

Props

  • el - HTMLElement whose scrollTop and scrollLeft to track.

Example

import {ScrollSensor} from 'libreact/lib/ScrollSensor';

<ScrollSensor el={element}>{({x, y}) =>
  `x: ${x}, y: ${y}`
}</ScrollSensor>