TanStackT
TanStack2y ago
4 replies
skinny-azure

Problems with list rendering with ssr

Hello, please tell me the solution for tanstack/virtual 3.0.4
I use virtualization for a list on an ssr page, without initialRect tags are not rendered on the server side, which is exactly what I need. For rendering on the server side, I added an initialRect accordingly, but with initialRect on the client, during the first render I get the entire list without virtualization, which is noticeable, how can I fix it?

const virtualList = useVirtualizer({
    count: tags.length,
    estimateSize: () => 29,
    getScrollElement: () => tagsRef.current,
    initialRect: { height: tags.length * 29, width 0},
  });
Was this page helpful?