useWindowScrollReact sensor hook that re-renders on window scroll.
import {useWindowScroll} from 'react-use';
const Demo = () => {
const {x, y} = useWindowScroll();
return (
<div>
<div>x: {x}</div>
<div>y: {y}</div>
</div>
);
};
// TODO: implement useWindowScroll function notImplemented(..._args: any[]): any { throw new Error('Not implemented'); } export default notImplemented; export const useWindowScroll = notImplemented;
Tests