ScrollSensor
FaCC that re-renders on when scroll position in a DOM element changes.
Props
el
- HTMLElement whosescrollTop
andscrollLeft
to track.
Example
import {ScrollSensor} from 'libreact/lib/ScrollSensor';
<ScrollSensor el={element}>{({x, y}) =>
`x: ${x}, y: ${y}`
}</ScrollSensor>