unstale

npm / react-virtuoso

react-virtuoso

What changed in react-virtuoso 3 to 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-20.

3 breaking6 new APIs and options1 performance20 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.3.1 on npm

react-virtuoso 429 changes

Breaking changes 3

  • In GroupedVirtuoso and GroupedTableVirtuoso, the callback now receives the index of the last real item rather than an index including group headers, and no longer fires when every group is empty.

    4.18.17release notes

  • Deprecated props from v0.x no longer work.

    4.0.0release notes

  • The top list element is now first in the container.

    4.0.0release notes

New APIs and options 5

  • A custom List wrapper can render a ul instead of a div, with its forwarded ref typed to the chosen element; Item is unchanged.

    4.18.14release notes

  • Adds a prop to ensure a minimum number of items are rendered before and after the viewport, useful when pixel-based overscan is insufficient for tall or collapsible items.

    4.17.0release notes

  • Adds support for specifying a fixed size for groups in grouped virtuoso.

    4.15.0release notes

  • The Components interface now accepts data and context generics.

    4.0.0release notes

  • Item components in lists and tables can receive data.

    4.0.0release notes

Performance 1

Fixes and other changes 20

  • Prevents a list from jumping back to the bottom when scrolling up after an item shrinks.

    4.18.23release notes

  • Fixes first-item offsets in lists with a gap so restoring state does not drift and index-zero scrolling respects explicit offsets and headers.

    4.18.22release notes

  • Fixed item drift, growing blank space, and endReached failures for lists using customScrollParent or useWindowScroll inside an element with CSS zoom.

    4.18.21release notes

  • Fixed initialTopMostItemIndex and scrollToIndex having no effect inside VirtuosoMockContext; the scroller now reports the requested scroll position directly so the list renders the target items in tests.

    4.18.20release notes

  • VirtuosoGrid clamps out-of-range scrollToIndex targets to the last available item.

    4.18.19release notes

  • The initial size probe stays within existing items, avoiding calls to computeItemKey and itemContent with a non-existent index; empty groups probe only headers and reset size state when items arrive.

    4.18.18release notes

  • TableVirtuoso now passes this optional prop to its resize observer instead of leaving it as a leftover prop on the scroller DOM.

    4.18.16release notes

  • Clamps the initial item count to available data, renders no items for explicitly empty data, and recomputes list state when the value changes after mount.

    4.18.15release notes

  • The compensating scroll now runs from a layout effect after the renderer acknowledges the DOM mutation, preventing a painted frame where the list is displaced by the prepended page.

    4.18.13release notes

  • Window-scrolling lists are measured before entering the viewport so their estimated height is included in the document layout.

    4.18.12release notes

  • Explicit undefined initial top-most item index values no longer crash when empty data updates to an object-form initial index.

    4.18.10release notes

  • The initial top-most item index is clamped to the available range, preventing out-of-range values from starting the list at a blank or mid-list position.

    4.18.9release notes

  • A default-positioned { index: 0 } is treated like 0, avoiding a redundant initial scroll and delayed followOutput.

    4.18.9release notes

  • The location object passed to scrollToIndex is no longer mutated; defaults are applied to a shallow copy.

    4.18.9release notes

  • Scroll target indexes beyond the available items are clamped to the last available item.

    4.18.8release notes

  • Fixed horizontal Virtuoso item positioning and scrolling in RTL layouts.

    4.18.7release notes

  • Fixes SSR layout collapse by rendering the window viewport in normal flow while preserving sticky top items.

    4.18.6release notes

  • React 19+ now correctly uses useSyncExternalStore instead of falling back to the legacy useState+useLayoutEffect subscription path, avoiding potential tearing in concurrent rendering.

    4.18.5release notes

  • Fixes atBottomStateChange in useWindowScroll lists when the Virtuoso instance is rendered below other page content.

    4.18.4release notes

  • Tree shaking works.

    4.0.0release notes

react-virtuoso 31 changes

New APIs and options 1

  • VirtuosoGrid supports data and accepts a second generic inferred from the data type.

    3.0.0release notes