@aaronhayes/react-scroll-hook 中文文档教程
React Scroll Hook
使用 React Scroll
Install
$ npm install --save @aaronhayes/react-scroll-hook
$ yarn add @aaronhayes/react-scroll-hook
Usage
import { Link, Element , Events, animateScroll as scroll, scrollSpy, scroller } from 'react-scroll'
import useScrollSpy from '@aaronhayes/react-scroll-hook';
const MyScrollWatchingComponent = () => {
const location = useScrollSpy();
console.log(location);
// Location will either be undefined or the current element scrolled to.
return (
<div>
<h1>
You are currently scrolled to: {location}
</h1>
</div>
)
}
See Also
React Scroll Hook
Hook for watching vertical scrolling location when using React Scroll
Install
$ npm install --save @aaronhayes/react-scroll-hook
$ yarn add @aaronhayes/react-scroll-hook
Usage
import { Link, Element , Events, animateScroll as scroll, scrollSpy, scroller } from 'react-scroll'
import useScrollSpy from '@aaronhayes/react-scroll-hook';
const MyScrollWatchingComponent = () => {
const location = useScrollSpy();
console.log(location);
// Location will either be undefined or the current element scrolled to.
return (
<div>
<h1>
You are currently scrolled to: {location}
</h1>
</div>
)
}
See Also
更多
你可能也喜欢
- @0xcert/ethereum-http-provider 中文文档教程
- @10play/navigation 中文文档教程
- @19h47/accordion 中文文档教程
- @1hive/connect-core 中文文档教程
- @1nd/react-social-login 中文文档教程
- @3drobotics/mapbox-gl 中文文档教程
- @3scarecrow/number-chinese-transformer 中文文档教程
- @5app/region-sync 中文文档教程
- @64robots/nuxt-content-blog 中文文档教程
- @7rabbit/ink-environment 中文文档教程