Repository navigation
perf(List): skip re-rendering unchanged lists and tables - #3575
Merged
Merged
Conversation
A refetch hands the loader a new array even when the data layer reuses every item. setDataBatch replaced the batch anyway, so the merged data changed and the whole list re-rendered. It now keeps the batch when the new one holds the same items in the same order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
react-aria re-renders every row and cell of a table whenever the table renders, because TableStateContext gets a new value on each render (adobe/react-spectrum#10759). The row memo only covers react-aria's hidden collection pass, so every render of the list's parent re-ran useTableRow and useTableCell for all rows. The table now returns its last element while nothing it renders has changed: loading state, onAction, the infinite scroll trigger, every entry's id and data, and the list, table, header, column, body and row props. Like the row memo, this needs renderDependencies on the row. The setup elements' children no longer go into the models' props; the models already hold them as header, body, columns and row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
🚀 Preview DeploymentPreview environments are ready:
Images:
|
mfal
enabled auto-merge
October 26, 2026 08:37
This was referenced Oct 26, 2026
Lisa18289
approved these changes
Oct 27, 2026
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.
A refetch that returns the same items, or a re-render of a list's parent, no longer re-renders the list or table. Two changes, one commit each:
ListLoaderState.setDataBatchkeeps a batch whose items did not change (components-base, shared by the React and Vue bindings). A loader that builds a new array on every fetch, typically a refetch whose data layer reuses the item instances, replaced the batch anyway. The merged data changed, and the whole list re-rendered. Now the batch stays when the new one holds the same items in the same order.List.Tableskips rendering while nothing it shows has changed. react-aria re-renders every row and cell whenever its table renders, becauseTableStateContextgets a new value on each render (Table: TableStateContext changes identity every render, so ResizableTableContainer re-renders every cell on width changes adobe/react-spectrum#10759). Flow's row memo only covers react-aria's hidden collection pass. So every render of the list's parent re-ranuseTableRowanduseTableCellfor all rows. The table now returns its last element while these stay equal:onAction, the infinite scroll triggerrendersSameAson the table models, alongside the existingTableRow.rendersSameAs)Like the row memo, this needs
renderDependencieson the row. The setup elements'childrenno longer go into the table models' props, since the models already hold them asheader,body,columnsandrow.adobe/react-spectrum#10816 addresses the same row re-renders inside react-aria. It would also help when a row does change, which this PR does not cover.
Related: #3528
Effect
Measured in mStudio on an invoice table with 160 rows, 6 columns and
renderDependencies. Dev build, React Profiler render time summed over all commits of one refetch, median of 10 runs:Without the patch a list-only refetch took 5 commits, each re-rendering all 160 rows' and 960 cells' react-aria wrappers. With it, only the loader component renders.
Tests
ListLoaderState.test.ts: a batch with the same items does not reach an observer again; one with a changed item does.List.browser.test.tsx(Table rows): counts react-aria's row renders through aTableRowview whoseclassNamefunction runs on each of them. Two parent re-renders render no row; a change torenderDependenciesstill does.Both tests fail without their change (verified by reverting it: 4 row renders instead of 0, 2 observer calls instead of 1). The existing table tests for changed row and cell props cover the cases where the table must render again.
🤖 Generated with Claude Code