2
2
3
3
This is a hook to control your scrollbar in react component!
4
4
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!
6
6
7
7
If you want to control the ` speed ` of scroll behaviour, it defaults to use ` requestAnimationFrame ` mode.
8
8
@@ -21,7 +21,7 @@ If you want to control the `speed` of scroll behaviour, it defaults to use `requ
21
21
## Installation
22
22
23
23
``` sh
24
- npm install react-smotth -scroll-hook
24
+ npm install react-smooth -scroll-hook
25
25
```
26
26
27
27
## Basic Usage
@@ -72,11 +72,11 @@ export const Demo = () => {
72
72
- ** scrollTo** ` (string|number) => void `
73
73
74
74
- 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') `
76
76
77
- - ** reachTop** ` boolean ` : Whether it is reach top of scrollContainer
77
+ - ** reachTop** ` boolean ` : Whether it has reached the top of scrollContainer
78
78
79
- - ** reachBottom** ` boolean ` : Whether it is reach bottom of scrollContainer
79
+ - ** reachBottom** ` boolean ` : Whether it has reached the bottom of scrollContainer
80
80
81
81
- ** scrollToPage** ` (number) => void ` : Pass page(` number ` ), which scroll to a distance as multiples of container size(` offsetWidth ` /` offsetHeight ` )
82
82
.e.g ` scrollToPage(1) ` ,` scrollToPage(-1) `
0 commit comments