Skip to content

Latest commit

 

History

History
17 lines (11 loc) · 327 Bytes

ScrollSensor.md

File metadata and controls

17 lines (11 loc) · 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>