Capítulo 8 de 20
A VirtualItem is the small geometry record passed to rendering code. It identifies the source index and key, then supplies start, end, size, and lane information for positioning.
key: The identity used by the rendered item; use a stable domain key when records can move.index: The source array index used to retrieve application data.start: The item's start offset along the active axis.end: The item's end offset along the active axis.size: The estimate before measurement, or the measured size afterward.lane: The lane assigned in a multi-lane layout.size comes from estimateSize.{virtualizer.getVirtualItems().map((virtualItem) => (
<div
key={virtualItem.key}
data-index={virtualItem.index}
style={{
position: 'absolute',
transform: `translateY(${virtualItem.start}px)`,
height: `${virtualItem.size}px`,
}}
>
{items[virtualItem.index].label}
</div>
))}
key for rendered identity and index for data lookup.start and size to the active CSS axis.lane when laying out masonry or multi-lane content.