22
33This is a hook to control your scrollbar in react component!
44
5- Basically; ` useSmoothScroll ` hook checks the ` HTMLElement ` 's API ` scrollTo ` , otherwise, use ` requestAnimationFrame ` to finish smooth scroll behaviour!
5+ Basically; ` useSmoothScroll ` hook use ` requestAnimationFrame ` to finish smooth scroll behaviour!
66
77If you want to control the ` speed ` of scroll behaviour, it defaults to use ` requestAnimationFrame ` mode.
88
@@ -21,7 +21,7 @@ If you want to control the `speed` of scroll behaviour, it defaults to use `requ
2121## Installation
2222
2323``` sh
24- npm install react-smotth -scroll-hook
24+ npm install react-smooth -scroll-hook
2525```
2626
2727## Basic Usage
@@ -72,11 +72,11 @@ export const Demo = () => {
7272- ** scrollTo** ` (string|number) => void `
7373
7474 - Pass ` number ` : the distance to scroll, e.g. ` scrollTo(400) `
75- - Pass ` string ` : the element seletor you want to scrollTo, passing to ` document.querySelector ` , e.g. ` scrollTo('#your-dom-id') `
75+ - Pass ` string ` : the element seletor you want to scrollTo, meanwhile passing to ` document.querySelector ` , e.g. ` scrollTo('#your-dom-id') `
7676
77- - ** reachTop** ` boolean ` : Whether it is reach top of scrollContainer
77+ - ** reachTop** ` boolean ` : Whether it has reached the top of scrollContainer
7878
79- - ** reachBottom** ` boolean ` : Whether it is reach bottom of scrollContainer
79+ - ** reachBottom** ` boolean ` : Whether it has reached the bottom of scrollContainer
8080
8181- ** scrollToPage** ` (number) => void ` : Pass page(` number ` ), which scroll to a distance as multiples of container size(` offsetWidth ` /` offsetHeight ` )
8282 .e.g ` scrollToPage(1) ` ,` scrollToPage(-1) `
0 commit comments