Skip to content

Commit 0edaaf7

Browse files
Update README.md
1 parent 836bc73 commit 0edaaf7

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

README.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,13 @@ const {
267267
totalSize,
268268
scrollToIndex,
269269
scrollToOffset,
270-
getIndexOffset,
271-
scrollToFn,
272270
} = useVirtual({
273271
size,
274272
parentRef,
275273
estimateSize,
276274
overscan,
277275
horizontal,
276+
scrollToFn
278277
})
279278
```
280279

@@ -326,7 +325,7 @@ const {
326325
- `scrollToIndex: Function(index: Integer, { align: String }) => void 0`
327326
- Call this function to scroll the top/left of the parentRef element to the start of the item located at the passed index.
328327
- `align: 'start' | 'center' | 'end' | 'auto'`
329-
- Defaults to `start`
328+
- Defaults to `auto`
330329
- `start` places the item at the top/left of the visible scroll area
331330
- `center` places the item in the center of the visible scroll area
332331
- `end` places the item at the bottom/right of the visible scroll area
@@ -339,15 +338,6 @@ const {
339338
- `center` places the offset in the center of the visible scroll area
340339
- `end` places the offset at the bottom/right of the visible scroll area
341340
- `auto` brings the offset into the visible scroll area either at the start or end, depending on which is closer. If the offset is already in view, it is placed at the `top/left` of the visible scroll area.
342-
- `getIndexOffset: Function(index: Integer, { align: String }) => Integer | undefined`
343-
- Call this function to return the offset of the item located at the passed index.
344-
- `align: 'start' | 'center' | 'end' | 'auto'`
345-
- Defaults to `start`
346-
- `start` returns the item's top/left offset
347-
- `center` returns the item's center offset
348-
- `end` returns the item's bottom/right offset
349-
- `auto` return's the item's start or end offset, depending on which is closer. If the item is already in view, the `top/left` offset will be returned
350-
- If `align: 'auto'` is passed and no scrolling is necessary to bring the item into view, `undefined` is returned.
351341

352342
# Contributors ✨
353343

0 commit comments

Comments
 (0)