You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ The `useSmoothScroll` hook finish smooth scroll behaviour in react component by
10
10
11
11
- 🚀 You don't need to warn about compatibility, it use `requsetAnimationFrame` api to finish smooth scroll behaviour.
12
12
13
-
- 👉 Provide `direction` option ,you can set `x` for vertical, `y` for horizontal.
13
+
- 👉 Provide `direction` option ,you can set `x` for horizontal, `y` for vertical.
14
14
15
15
- 💧 No Third Party dependencies, light and pure.
16
16
@@ -60,7 +60,7 @@ export const Demo = () => {
60
60
61
61
-**ref:**`RefObject<HTMLElement>`, container which set as `overflow: scroll`.
62
62
-**speed:** Distance in one frame to move in `requestAnimationFrame` mode, defaults to `100`, if not provide, speed depends on native API `scrollTo`.
63
-
-**direction:** Scroll direction
63
+
-**direction:** Scroll direction, `x` for horizontal or `y` for vertical.
64
64
-**threshold:** Judge scroll is finished has an error range, .defaults to `1`.
65
65
66
66
### Returns of Hook
@@ -70,13 +70,13 @@ export const Demo = () => {
70
70
- Pass `number`: the distance to scroll, e.g. `scrollTo(400)`
71
71
- Pass `string`: the element seletor you want to scrollTo, meanwhile passing to `document.querySelector`, e.g. `scrollTo('#your-dom-id')`
72
72
73
-
-**reachTop**`boolean`: Whether it has reached the top of scrollContainer
73
+
-**reachTop**`boolean`: Whether it has reached the top of refContainer
74
74
75
-
-**reachBottom**`boolean`: Whether it has reached the bottom of scrollContainer
75
+
-**reachBottom**`boolean`: Whether it has reached the bottom of refContainer
76
76
77
77
-**scrollToPage**`(number) => void`: Pass page(`number`), which scroll to a distance as multiples of container size(`offsetWidth`/`offsetHeight`)
78
78
.e.g `scrollToPage(1)`,`scrollToPage(-1)`
79
79
80
-
-**refreshState**`() => void`: Manually refresh the state of `reachTop` and `reachBottom`, just an API as you need, and possibly useful in some situation.
80
+
-**refreshState**`() => void`: Manually refresh the state of `reachTop` and `reachBottom`, possibly useful in some situation.
81
81
82
-
-**refreshSize**`() => void`: Manually refresh the size of ref container, just an API as you need, and possibly useful in some situation.
82
+
-**refreshSize**`() => void`: Manually refresh the size of ref container, possibly useful in some situation.
0 commit comments