TanStackT
TanStack3y ago
1 reply
sad-indigo

Is there a way to access instance of the virtualizer from another react component?

I have a page with a virtual scrolling window of items, and in the page header I have a nav where I would like to use the scrollToIndex() function to scroll to specific indexes in the list of virtual items. The nav is not a parent or child of the component where the items are rendered. Is there a way to call scrollToIndex from outside of the component where the virtualizer was instantiated?
Was this page helpful?