Skip to content

fix: redundant re-renders in StatsCards (#164)#225

Merged
dDevAhmed merged 2 commits into
DigiNodes:mainfrom
laxjovial:fix-redundant-rerenders-statscards-164
Jun 1, 2026
Merged

fix: redundant re-renders in StatsCards (#164)#225
dDevAhmed merged 2 commits into
DigiNodes:mainfrom
laxjovial:fix-redundant-rerenders-statscards-164

Conversation

@laxjovial
Copy link
Copy Markdown
Contributor

📚 Overview

This PR resolves the issue with redundant re-renders occurring in the StatsCards component, which was identified during a recent performance audit.

🎯 Objectives Completed

  • Implemented Fix: Wrapped the StatsCards component in React.memo to prevent unnecessary re-renders when the parent component updates, preserving application performance.
  • Added Unit Tests: Introduced a comprehensive unit testing suite for StatsCards (StatsCards.test.tsx) to ensure core functionality, conditional rendering, and integration with the useTrust hook operate correctly.
  • Verified with Protocol Invariants: Ensured that the implementation matches platform expectations with zero regressions across the broader component ecosystem.

🧩 Technical Scope

  • Modified src/components/features/StatsCards.tsx
  • Created src/components/features/__tests__/StatsCards.test.tsx

✅ Acceptance Criteria

  • Implementation is functional and prevents redundant re-renders.
  • All newly added tests passed successfully.
  • No UI or functionality regressions introduced.

🔗 References

Closes #164
Internal Ref #FE-164

laxjovial and others added 2 commits June 1, 2026 17:22
- Wrapped StatsCards component with React.memo to prevent unnecessary re-renders
- Added unit tests for StatsCards component
@dDevAhmed dDevAhmed merged commit 1e521e7 into DigiNodes:main Jun 1, 2026
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.

Redundant re-renders in StatsCards

2 participants