Primary fix: setTeamTimers now bails out with `return prev` when the
value hasn't changed, preventing a full DraftRoom re-render on every
1-second timer tick (was 33% of profiler samples).
Memoization: wrap AvailableParticipantsSection, TeamsDraftedGrid,
QueueSection, SidebarRecentPicks, and DraftGridSection in React.memo
so timer ticks don't cascade into heavy components that don't use
timer state.
Stable refs: wrap nine action handlers in useCallback and extract two
inline arrow functions from props objects so memo() comparisons
actually bail out. Memoize the { numFlexPicks } object passed to
TeamsDraftedGrid.
socketVersion: expose an incrementing counter from useDraftSocket so
the socket handler effect re-registers on socket recreation.
Async cleanup: add abort flag + in-flight guard to the visibilitychange
JWT refresh handler to prevent concurrent executions and stale state
updates after unmount. Add abort flag to useDraftNotifications
permissions.query() to prevent dangling onchange if unmounted
mid-promise.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| __tests__ | ||
| $leagueId.draft-board.$seasonId.tsx | ||
| $leagueId.draft.$seasonId.tsx | ||
| $leagueId.server.ts | ||
| $leagueId.settings.tsx | ||
| $leagueId.sports-seasons.$sportsSeasonId.server.ts | ||
| $leagueId.sports-seasons.$sportsSeasonId.tsx | ||
| $leagueId.standings.$seasonId.teams.$teamId.tsx | ||
| $leagueId.standings.$seasonId.tsx | ||
| $leagueId.tsx | ||
| new.tsx | ||