Skip to content

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

Open
Moonwalker-rgb wants to merge 2 commits into
MettaChain:mainfrom
Moonwalker-rgb:fix/456-inline-handlers-memo
Open

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

Conversation

@Moonwalker-rgb

Copy link
Copy Markdown

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.

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