Description
In our developer dashboard, whenever a global statistics sync triggers (via SSE in DashboardSSEProvider), both the PinnedRepos.tsx and TopRepos.tsx components completely re-render all repo cards, even when the contribution counts or items remain unchanged. This results in heavy UI thread thrashing on active profiles. We need to memoize these cards.
Requirements
- Component Memoization: Wrap PinnedRepos and TopRepos individual cards with
React.memo using a strict key equality comparator.
- Computation Caching: Cache heavy sorting algorithms for top/pinned lists using the
useMemo hook.
Files to Modify
src/components/PinnedRepos.tsx
src/components/TopRepos.tsx
Description
In our developer dashboard, whenever a global statistics sync triggers (via SSE in
DashboardSSEProvider), both thePinnedRepos.tsxandTopRepos.tsxcomponents completely re-render all repo cards, even when the contribution counts or items remain unchanged. This results in heavy UI thread thrashing on active profiles. We need to memoize these cards.Requirements
React.memousing a strict key equality comparator.useMemohook.Files to Modify
src/components/PinnedRepos.tsxsrc/components/TopRepos.tsx