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
`Autoscroll(Component)`: returns the passed component without any additional markup.
42
40
It scrolls the root node rendered by the component to the bottom whenever it updates, but not if the user has scrolled up.
43
41
44
-
⚠️ You must Explicitly pass down props to the wrapped component. ⚠️
42
+
## ⚠️ caveats ⚠️
43
+
44
+
- You must Explicitly pass down props to the wrapped component. This is so an event listener can be attached. This means you can also pass down your own props to the wrapped component
45
+
- The wrapped component must be a Class-based component, not a functional one, because `Autoscroll` uses a `ref`.
46
+
- This package is agnostic about any CSS you use. However., it requires that you provide the adequate CSS to make the wrapped component have a scroll bar. (ie. `overflow-y:scroll;` and a set `height`)
The `isScrolledDownThreshold` option is used when determining whether the user has scrolled back to the bottom. If the element's `scrollBottom` is within `isScrolledDownThreshold`px of the maximum scroll (`scrollHeight`), the component will scroll down on the next updates.
53
+
This option exists because scrolling almost all the way down, but not entirely, can be interpreted as a sign that the user intends to see the bottom of the list.
0 commit comments