TanStackT
TanStack3y ago
7 replies
brilliant-orange

rowVirtualizer.getVirtualItems() returning values in v3.0.0-beta.61 but not v3.0.1

Hey all -

Problem -
When updating from beta version to stable version, rowVirtualizer.getVirtualItems() returns []. Reverting version back to beta fixes empty array issue

Homework -
- Checked Tanstack Virtual issues
- Googled/ Stackoverflow'd
- Checked offical docs & changelog for any mention of changes

Example -
// useVirtualizer instantiation 
    const rowVirtualizer = useVirtualizer({
      count: hasNextPage ? sortedData.length + 1 : sortedData.length,
      getScrollElement: () => scrollElement.current,
      estimateSize: () => 36,
      overscan: 5,
    });

// rowVirtualizer usage
const options = rowVirtualizer.getVirtualItems().map((virtualItem) => { ... }


All boilerplate pulled from offical docs (prior to v3 stable release - specifically this example https://tanstack.com/virtual/v3/docs/examples/react/infinite-scroll). Confirmed that the docs and my code look similar besides the styling markup. Happy to provide more context if required. Thanks!
An example showing how to implement Infinite Scroll). in React Virtual
Was this page helpful?