use-scroll-breakpoint
v1.1.2
Published
react-hooks, an fancy way to get the relation between element.scrollTop and breakpoint
Downloads
10
Maintainers
Readme
use-scroll-breakpoint
react hooks, 快速获取滚动状态
快速实现 stikcy 效果
小而精
install
npm
yarn add use-scroll-breakpoint
or
npm install use-scroll-breakpoint
usage
import useScrollBreakpoint from 'use-scroll-breakpoint';
const App = () => {
// isBreak: window.scrollTop > 500
const [isBreak] = useScrollBreakpoint({
breakpoint: 500,
});
return <div className='app'>...</div>;
};