TanStackT
TanStack16mo ago
9 replies
sacred-rose

Creating a placeholder

Is there a way to make a placeholder?

  const rowVirtualizer = useVirtualizer({
    count: rows.length,
    getScrollElement: () => rowsRef.current,
    estimateSize: (index) => getScaledRowHeight(rows[index].type, fontSize),
    getItemKey: (index) => {
      return `${rows[index].type}-${rows[index].targetId ?? index}`;
    },
    overscan: 50,
  });
  const items = rowVirtualizer.getVirtualItems();
Was this page helpful?