npm / react-window
react-window
What changed in react-window 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-17.
6 new APIs and options3 performance2 behavior and defaults13 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initreact-window 224 changes
New APIs and options 6
Accepts an optional ownerDocument parameter and caches the measured size separately for each document.
Grid accepts an optional columnKey prop.
List accepts an optional rowKey prop.
Grid accepts an optional rowKey prop.
Use the defaultHeight prop to server render the initial set of rows.
Use the defaultWidth prop to server render the initial set of cells.
Performance 3
Fixes unnecessary size calculations when scrolling beyond cached bounds.
Avoids allocating bounds for items preceding fixed-size jumps.
Calculates fixed-size visible ranges directly and searches cached variable-size bounds instead of scanning from the beginning.
Behavior and default changes 2
List, Grid, and useDynamicRowHeight use the ResizeObserver, requestAnimationFrame, and document belonging to the window containing the list, supporting rendering into another window such as an iframe or portal pop-up.
Uses fractional percentage sizing.
Fixes and other changes 13
Rows with an aria-hidden attribute are now measured.
Fixes center alignment near list boundaries.
Fixes dropped prop updates.
Fixes stale row measurements when rows are reordered by key.
Fixes scrolling and alignment in RTL layouts.
Improves scrollToRow accuracy for rows with dynamic heights.
Grid updates its direction when the dir prop changes after mount.
useDynamicRowHeight no longer instantiates ResizeObserver when server-rendering.
Imperative scroll-to methods throw a RangeError instead of a regular Error when passed an invalid index.
Adjust the TypeScript return type to work around a ReactNode versus ReactElement mismatch caused by #875.
The return type is explicitly annotated as ReactElement to fix TypeScript warnings for React versions 18.0–18.2.
The return type is explicitly annotated as ReactElement to fix TypeScript warnings for React versions 18.0–18.2.
Adjust the TypeScript return type to work around a ReactNode versus ReactElement mismatch caused by #875.