Packages

@tanstack/virtual-core

3.19.11 · 3 Nov 2026MIT56.2M / weekRepositoryHomepagenpmAtom feed

Your version

3.13.14

30 Dec 2025Where it was published

3.19.11 is the newest release of 3.x.

In short

1 fixed

Release note

Patch Changes

  • Correct lane assignments when lane count changes dynamically

    Fixed a critical bug where changing the number of lanes dynamically would cause layout breakage with incorrect lane assignments. When the lane count changed (e.g., from 3 to 2 columns in a responsive masonry layout), some virtual items would retain their old lane numbers, causing out-of-bounds errors and broken layouts.

    Root Cause: After clearing measurements cache on lane change, the virtualizer was incorrectly restoring data from initialMeasurementsCache, which contained stale lane assignments from the previous lane count.

    Fix: Skip initialMeasurementsCache restoration during lane transitions by checking the lanesSettling flag. This ensures all measurements are recalculated with correct lane assignments for the new lane count.

    Before:

    // With lanes = 2
    virtualItems.forEach((item) => {
      columns[item.lane].push(item) // ❌ Error: item.lane could be 3
    })

    After:

    // With lanes = 2
    virtualItems.forEach((item) => {
      columns[item.lane].push(item) // ✅ item.lane is always 0 or 1
    })

    This fix is essential for responsive masonry layouts where column count changes based on viewport width. No performance impact as it only affects the lane change transition path.

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.