You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf-todo.md #20 mentions recreations of rows: createCoreRowModel memoizes on [table.options.data], so a new array replaces every Row and Cell even when the row objects in it are identical. That is intentional and tested, and the docs ask for stable references — but row identity is what React.memo, Vue keys and Glimmer {{#each}} keys compare, and caches (Apollo, React Query, sockets) hand you a fresh array per update.
React 19.3, react-table 9.2.4, 10 000 rows × 20 cols, 66 mounted, rows in React.memo with a stable getRowId:
update
today
with the opt-in
unrelated re-render
0
0
new array, identical row objects
1320
0
new array, one row changed
1320
20
1320 is every mounted cell, so the cost is the whole viewport whether one row changed or none.
Would an opt-in be welcome? reuseRowInstances: true keeps a Row when its id, original row object, index and parent are unchanged. Default off, so current behaviour and the test that asserts it are untouched.
Implementation sketch + tests, if it helps the discussion: johanrd#8 (all 1334 table-core tests pass). Happy to open a PR here if interest.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
perf-todo.md#20 mentions recreations of rows:createCoreRowModelmemoizes on[table.options.data], so a new array replaces everyRowandCelleven when the row objects in it are identical. That is intentional and tested, and the docs ask for stable references — but row identity is whatReact.memo, Vue keys and Glimmer{{#each}}keys compare, and caches (Apollo, React Query, sockets) hand you a fresh array per update.React 19.3, react-table 9.2.4, 10 000 rows × 20 cols, 66 mounted, rows in
React.memowith a stablegetRowId:1320 is every mounted cell, so the cost is the whole viewport whether one row changed or none.
Would an opt-in be welcome?
reuseRowInstances: truekeeps aRowwhen its id, original row object, index and parent are unchanged. Default off, so current behaviour and the test that asserts it are untouched.Implementation sketch + tests, if it helps the discussion: johanrd#8 (all 1334 table-core tests pass). Happy to open a PR here if interest.
All reactions