T
TanStack3y ago
rare-sapphire

disable scrollToFn on the fly ?

Is it possible to disable scrollToFn option after virtualizer initialization ?
3 Replies
absent-sapphire
absent-sapphire3y ago
Yes, you can pass your own scrollToFn function
rare-sapphire
rare-sapphireOP3y ago
yes but how can I reset the scrollToFn as if it has been never passed as argument @piecyk ?
absent-sapphire
absent-sapphire3y ago
hmm, don't follow exactly, but you can pass scrollToFn as arguemnt, for arguments checkout type declaratiaons
useVirtualizer({
count: 10000,
getScrollElement: () => parentRef.current,
estimateSize: () => 50,
scrollToFn: () => {
// TODO handle scrolling
}
})
useVirtualizer({
count: 10000,
getScrollElement: () => parentRef.current,
estimateSize: () => 50,
scrollToFn: () => {
// TODO handle scrolling
}
})

Did you find this page helpful?