docs(stories): use react-window v2 in examples - #36485
Draft
AKnassa wants to merge 1 commit into
Draft
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
FixedSizeListcomponent 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
^2so they keep working too. The migration follows the exact pattern the maintainer blessed in the issue (passing Fluent's List through thetagNameprop).What changed
ListwithrowComponent/rowCount/rowHeight/rowProps, sizing via container style,scrollToRowfor the Tree keyboard navigation).^2.3.0and dropped the v1-only@types/react-window(v2 ships its own types).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)