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