Skip to content

Conversation

@AladinoBorges
Copy link
Contributor

Description of changes

This pull request contains a single, isolated fix for a runtime infinite-update loop that manifested as the React error "Maximum update depth exceeded". The problem was caused by an effect that could call setState repeatedly when measurements changed (resize/overflow). The change adds a shallow-equality guard so the state only updates when the computed value actually differs, preventing repeated re-renders.

  • packages/ui/react/src/components/Primitives/Tooltip/Tooltip.tsx: add guarded state update in overflow/resize effect to avoid redundant setState calls, preventing infinite loop.

GitHub issues resolved by this PR

  • N/A

Quality Assurance

  • Once the changes in this PR are merged and deployed, success criteria is:
    • Build: packages/ui/react builds successfully (TypeScript and bundle build complete).
    • Tests: Unit tests covering the Tooltip component pass locally.
    • Runtime verification: Reproduced the previous infinite-update loop locally (dev server) before the fix; after applying the guard the console no longer shows the "Maximum update depth exceeded" error when exercising the same interaction.

More info

Identified Error (using the package with NextJS)

image

…-react/tooltip-maximum-update-depth-exceeded-error
…-react/tooltip-maximum-update-depth-exceeded-error
@changeset-bot
Copy link

changeset-bot bot commented Dec 29, 2025

🦋 Changeset detected

Latest commit: 0e2df0d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@devopness/ui-react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

…r' of github.com:AladinoBorges/devopness into fix/ui-react/tooltip-maximum-update-depth-exceeded-error
@jfoliveira jfoliveira enabled auto-merge (squash) December 29, 2025 23:37
Copy link
Contributor

@jfoliveira jfoliveira left a comment

Choose a reason for hiding this comment

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

LGTM

@jfoliveira jfoliveira merged commit fdbc8c2 into devopness:main Dec 29, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants