Skip to content

docs(stories): use react-window v2 in examples - #36485

Draft
AKnassa wants to merge 1 commit into
microsoft:masterfrom
AKnassa:ak-issue-35580-react-window-v2-stories
Draft

docs(stories): use react-window v2 in examples#36485
AKnassa wants to merge 1 commit into
microsoft:masterfrom
AKnassa:ak-issue-35580-react-window-v2-stories

Conversation

@AKnassa

@AKnassa AKnassa commented Aug 1, 2026

Copy link
Copy Markdown

Previous Behavior

The virtualization examples for List, Table, DataGrid, and Tree (plus the docsite icon grid) were written for react-window version 1. Version 2 removed the FixedSizeList component those examples used — so anyone copying our docs with the current react-window got broken code, and the "open in sandbox" button produced crashing sandboxes (it always installs the latest version).

New Behavior

All the examples use the react-window 2 API and work with the current package. Sandbox exports now pin react-window ^2 so they keep working too. The migration follows the exact pattern the maintainer blessed in the issue (passing Fluent's List through the tagName prop).

What changed

  • Migrated 5 story files and the docsite IconGrid to the v2 API (List with rowComponent / rowCount / rowHeight / rowProps, sizing via container style, scrollToRow for the Tree keyboard navigation).
  • Bumped the repo's react-window dev dependency to ^2.3.0 and dropped the v1-only @types/react-window (v2 ships its own types).
  • Fixed two dead links to the old react-window docs, and a small bug where the icon grid's row count could be fractional.

No release-notes change file needed — every touched package is private.

How to verify

Type-check, lint, React 17/18 integration checks, and SSR story rendering are all green. We also ran the storybook live: the virtualized lists render a fixed window, scroll correctly, and log zero errors. To see it yourself: yarn nx run react-list-stories:storybook → Components/List → VirtualizedList.

Related Issue(s)

react-window 2.x removed FixedSizeList, so the List, Table,
DataGrid, and Tree virtualization examples (and the docsite icon
grid) broke for anyone following them with the latest package -
sandbox exports resolve react-window to 'latest' and crash.

Migrate the examples to the v2 API (List with rowComponent /
rowCount / rowHeight / rowProps, sizing via container style,
useListRef + scrollToRow), forwarding Fluent's List through the
tagName prop per maintainer guidance in microsoft#35580. Pin the
sandbox-export dependency to react-window ^2, bump the repo
devDependency, and drop the v1-only @types/react-window (v2 ships
its own types). Dead v1 doc links updated.

Verified: type-check and lint for all four projects, React 17/18
integration type-checks, SSR story rendering, and a live storybook
smoke (windowing and scroll work; IconGrid rowCount also gains a
Math.ceil fix for fractional counts).

Fixes microsoft#35580
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: FixedSizeList doesn't work with latest version of react-window

1 participant