primitives
primitives copied to clipboard
Popper: Fix infinite re-renders
Fixes the following error:
Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render. Stack: React 4 PopperAnchor popper.tsx:84
Description
Add context.onAnchorChange to useEffect deps array to prevent infinite re-renders
⚠️ No Changeset found
Latest commit: 1fbac02be219c444128f2d6903c7641b77419916
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Add close #3546 in PR template to manage pr & issue more efficiently
Can confirm these changes fix the issue for us
We're really counting on this for our project – is there any ETA for the fix? Or maybe a temporary workaround we could use in the meantime? It's currently breaking our frontend.
We're really counting on this for our project – is there any ETA for the fix? Or maybe a temporary workaround we could use in the meantime? It's currently breaking our frontend.
https://github.com/radix-ui/primitives/pull/3386#issuecomment-2999991988
Should be addressed here: https://github.com/radix-ui/primitives/pull/3614