Skip to content

perf(property-list): memoize property list re-renders - #1285

Merged
nanaf6203-bit merged 2 commits into
MettaChain:mainfrom
ameeribro4-sudo:fix/issue-1177-optimize-property-list-renders
Oct 15, 2026
Merged

nanaf6203-bit merged 2 commits into
MettaChain:mainfrom
ameeribro4-sudo:fix/issue-1177-optimize-property-list-renders

Conversation

@ameeribro4-sudo

Copy link
Copy Markdown
Contributor

Summary

Optimizes re-renders of the PropertyList component so unchanged inputs no longer force the virtualized grid to rebuild its configuration or re-render its rows. The grid now skips work entirely when the parent re-renders with the same properties, view mode and class name.

Problem

VirtualizedPropertyGrid was exported as a plain function component, so any state change higher in the tree re-rendered it and every visible property card even when nothing it consumed had changed. On top of that, useVirtualizer was handed a fresh options object on every render, causing the virtualizer to be reconfigured each time regardless of whether its inputs had changed.

Changes Made

  • Exported the grid through memo() in src/components/VirtualizedPropertyGrid.tsx so shallow-equal props skip the render.
  • Extracted the virtualizer configuration into a useMemo keyed on [rowCount, viewMode], giving useVirtualizer a stable options object between renders.

Implementation Details

Memoization is applied at the component boundary rather than to individual rows, which covers the common case of a parent re-rendering because of unrelated store or filter state while the result set itself is untouched. Row-level rendering logic, the column measurement effect and the public props interface were left as they were.

Closes #1177

Closes #1176

Closes #1175

Closes #1178

@drips-wave

drips-wave Bot commented Oct 15, 2026

Copy link
Copy Markdown

@ameeribro4-sudo Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@nanaf6203-bit nanaf6203-bit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nanaf6203-bit
nanaf6203-bit merged commit 7700d74 into MettaChain:main Oct 15, 2026
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants