Skip to content

[DISC-008] Fix discovery feed infinite render loop - #72

Merged
chev0004 merged 1 commit into
developfrom
fix/disc-008
Jun 21, 2026
Merged

[DISC-008] Fix discovery feed infinite render loop#72
chev0004 merged 1 commit into
developfrom
fix/disc-008

Conversation

@chev0004

Copy link
Copy Markdown
Owner

Outline

Summary

Fixes a "Maximum update depth exceeded" crash on the discovery feed. The loading fallback renders DiscoveryPage without a profiles prop, so the profiles = [] default created a new array reference on every render and the prop-to-state sync effect (setProfileItems(profiles)) looped infinitely.


Changes & Enhancements

  • Type of Change:
    • Feature
    • Bugfix
    • Refactor
    • Chore
  • Changes:
    • (discovery):
      • Default the profiles prop to a stable module-level EMPTY_PROFILES constant so its reference is identical across renders, stopping the prop-to-state effect from re-firing.

Page / App Changes

Affected Next.js Routes (Local):

  • /[lang]
Before (Screenshot)
After (Screenshot)

Component / Storybook Changes

Affected Storybook Components (Local):

Before (Screenshot)
After (Screenshot)

Not Doing


Other (Remarks)


Checklists

  • No out-of-scope changes are included.
  • Removed unnecessary debug code (e.g., console.log, debugger).
  • Self-reviewed and tested locally.

@chev0004 chev0004 self-assigned this Jun 21, 2026
@chev0004
chev0004 merged commit d3f2485 into develop Jun 21, 2026
1 check passed
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.

1 participant