primitives icon indicating copy to clipboard operation
primitives copied to clipboard

Popper: Fix infinite re-renders

Open raymondkneipp opened this issue 8 months ago • 3 comments

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

raymondkneipp avatar Apr 25 '25 14:04 raymondkneipp

⚠️ 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

changeset-bot[bot] avatar Apr 25 '25 14:04 changeset-bot[bot]

Add close #3546 in PR template to manage pr & issue more efficiently

nayounsang avatar May 17 '25 08:05 nayounsang

Can confirm these changes fix the issue for us

c-ehrlich avatar Jun 17 '25 11:06 c-ehrlich

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.

exsesx avatar Jun 24 '25 10:06 exsesx

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

raymondkneipp avatar Jun 24 '25 17:06 raymondkneipp

Should be addressed here: https://github.com/radix-ui/primitives/pull/3614

chaance avatar Jul 03 '25 00:07 chaance