Element that scrolls the list, for lists that scroll along with other content (e.g. the page):
- "window" to scroll with the page
- an ancestor element that scrolls (e.g. stored with a
useState ref callback); null until it has mounted
The list renders at its full height and only renders the rows visible within the scroll element's viewport.
Its position within the scroll element is measured whenever it renders, scrolls, or resizes,
and whenever content before it is resized, inserted, or removed (e.g. an image loading above the list).
scrollToRow scrolls the scroll element
defaultHeight is used as the viewport height until the scroll element has been measured (e.g. during server rendering)
- percentage row heights are relative to the scroll element's viewport height
defaultScrollOffset is ignored
ℹ️ While the scroll element is null, the list renders the first rows (as it does during server rendering).
⚠️ The list itself doesn't scroll, so its onScroll handler isn't called;
listen to the scroll element's "scroll" events instead (or use the useIsScrolling hook).
|