Skip to content

fix(perf): wrap inline handlers with useCallback and add React.memo - #562

Merged
nanaf6203-bit merged 2 commits into
MettaChain:mainfrom
Moonwalker-rgb:fix/456-inline-handlers-memo
Jun 29, 2026
Merged

fix(perf): wrap inline handlers with useCallback and add React.memo#562
nanaf6203-bit merged 2 commits into
MettaChain:mainfrom
Moonwalker-rgb:fix/456-inline-handlers-memo

Conversation

@Moonwalker-rgb

Copy link
Copy Markdown
Contributor

Summary

Fixes #456

Wraps inline handlers with useCallback and adds React.memo to components to prevent unnecessary child re-renders.

Changes

  • PropertyCard.tsx: Wrap 4 inline handlers with useCallback; wrap component in React.memo
  • MultiChainPortfolio.tsx: Wrap handleRefresh with useCallback; wrap component in React.memo
  • WalletConnectedView.tsx: Wrap component in React.memo

Testing

  • TypeScript compilation: no new errors introduced
  • All modified files pass type-checking

Closes #456

…bility (MettaChain#455)

Replace key={index} with stable composite keys across components
where lists can mutate, improving screen-reader announcements:

- MultiChainPortfolio: use propertyId-fromChain-toChain for bridge suggestions
- WalletModal: use content+index for warning/block messages
- SecureTransactionConfirmation: use content+index for warning/risk messages
- TransactionConfirmation: use content+index for warning/block messages

Closes MettaChain#455
@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@Moonwalker-rgb 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

Copy link
Copy Markdown
Contributor

Conflicts with #541 on WalletModal.tsx; #541 covers more issues at broader scope so I am merging it first.

@nanaf6203-bit
nanaf6203-bit merged commit 4cef4c1 into MettaChain:main Jun 29, 2026

Copy link
Copy Markdown
Contributor

Nice perf cleanup with useCallback + React.memo — thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf: inline handlers defeat memoisation across the app

2 participants