FaCC that re-renders on window scroll.
import {WindowScrollSensor} from 'libreact/lib/WindowScrollSensor';
<WindowScrollSensor>{({x, y}) =>
`x: ${x}, y: ${y}`
}</WindowScrollSensor>
You can also use it without children.
<WindowScrollSensor onChange={({x, y}) => console.log(x, y)} />
HOC that merges windowScroll
prop into enhanced component's props.
import {withWindowScroll} from 'libreact/lib/WindowScrollSensor';
React stateful component decorator that adds windowScroll
prop.
import {withWindowScroll} from 'libreact/lib/WindowScrollSensor';
@withWindowScroll
class MyComp extends Component {
}