hooks:什锦的React钩子

时间:2021-05-01 19:50:21
【文件属性】:
文件名称:hooks:什锦的React钩子
文件大小:287KB
文件格式:ZIP
更新时间:2021-05-01 19:50:21
react hooks reactjs react-components debounce @ haensl / hooks 什锦的React钩子。 安装 通过npm $ npm install -S @haensl/hooks 通yarn $ yarn add @haensl/hooks 用法 在组件中使用挂钩: import { useDebounce } from '@haensl/hooks' ; const DebouncedButton = ( ) => { const handler = useDebounce ( ( ) => { console . log ( 'click' ) ; } , 50 ) ; return ( < button onClick = { handler } > click me < / button > ) ; } ; 可用钩子 :对函数进行动画处理。 :跟踪容器的。
【文件预览】:
hooks-master
----.gitignore(2KB)
----package.json(4KB)
----package-lock.json(931KB)
----src()
--------useDebounce()
--------useOnScroll()
--------useAnimationFrame()
--------index.js(858B)
--------useBoundingClientRect()
--------useWindowScroll()
--------useIsScrolling()
--------useWindowSize()
--------package-tests()
----test.setup.js(123B)
----LICENSE(1KB)
----CHANGELOG.md(2KB)
----rollup.config.js(3KB)
----README.md(8KB)
----.circleci()
--------config.yml(10KB)
----.npmignore(91B)

网友评论