Skip to content

fix: maximum depth exceeded state update#1847

Merged
paustint merged 1 commit into
mainfrom
fix/state-update-issue
Jul 3, 2026
Merged

fix: maximum depth exceeded state update#1847
paustint merged 1 commit into
mainfrom
fix/state-update-issue

Conversation

@paustint

@paustint paustint commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

fix: maximum depth exceeded state update

  • Test - this is a critical component

Refs: betterstack errors 9d9b4c94090709233f3a25c00b4b45e8c8cf252903f6972e77fb442bcbcb48ee e254a767a2d54e918254ac478b1433ff938d46df381665779bc03ccafe933b17

@paustint paustint marked this pull request as ready for review July 2, 2026 14:35
Copilot AI review requested due to automatic review settings July 2, 2026 14:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses React “Maximum update depth exceeded” errors by removing effect-synced “derived state” in several UI components and instead deriving values during render (memoized where appropriate). This reduces nested update cascades caused by inline props (arrays/functions) that change identity on every parent render.

Changes:

  • Tabs: replace effect-driven activeTab/filteredTabs state with useMemo-derived values.
  • Combobox variants: remove effect-synced selectedItem/label/title state and derive them during render (memoized).
  • Anonymous Apex: remove a redundant results -> visibleResults syncing effect and rely on the single filtering effect.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
libs/ui/src/lib/tabs/Tabs.tsx Stops mirroring activeTab/filteredTabs into state to avoid nested update cascades.
libs/ui/src/lib/form/combobox/ComboboxWithItemsVirtual.tsx Derives selection + labels during render to avoid effect-triggered state updates.
libs/ui/src/lib/form/combobox/ComboboxWithItemsTypeAhead.tsx Same derived-selection approach to prevent repeated effect-driven updates.
libs/ui/src/lib/form/combobox/ComboboxWithItems.tsx Removes effect-synced derived state for selection/labels/titles (memoized).
libs/ui/src/lib/form/combobox/ComboboxWithGroupedItems.tsx Same derived-selection approach for grouped items.
libs/features/anon-apex/src/AnonymousApex.tsx Removes redundant state sync effect, reducing extra render cycles.

Comment thread libs/ui/src/lib/form/combobox/ComboboxWithItems.tsx Outdated
Comment thread libs/ui/src/lib/form/combobox/ComboboxWithGroupedItems.tsx Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread libs/ui/src/lib/tabs/Tabs.tsx
Refs:
betterstack errors
9d9b4c94090709233f3a25c00b4b45e8c8cf252903f6972e77fb442bcbcb48ee
e254a767a2d54e918254ac478b1433ff938d46df381665779bc03ccafe933b17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@paustint paustint merged commit 8b2ad21 into main Jul 3, 2026
9 checks passed
@paustint paustint deleted the fix/state-update-issue branch July 3, 2026 15:25
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.

2 participants