Skip to content

Commit 08920a8

Browse files
authored
fix: measureRef type in VirtualItem, add missing onScrollElement, scrollOffsetFn (#110)
1 parent a7bf0c2 commit 08920a8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

types/index.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export type VirtualItem = {
1212
start: number
1313
end: number
1414
size: number
15-
measureRef: React.RefObject<any>
15+
measureRef: (el: HTMLElement | null) => void
1616
}
1717

1818
declare function useVirtual<T>(options: {
@@ -35,6 +35,8 @@ declare function useVirtual<T>(options: {
3535
[key: string]: any
3636
}
3737
keyExtractor?: (index: number) => number | string
38+
onScrollElement?: React.RefObject<HTMLElement>
39+
scrollOffsetFn?: () => number
3840
}): {
3941
virtualItems: VirtualItem[]
4042
totalSize: number

0 commit comments

Comments
 (0)