Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ref for triggers gets detached on every render #3378

Open
misha-erm opened this issue Feb 13, 2025 · 1 comment
Open

Ref for triggers gets detached on every render #3378

misha-erm opened this issue Feb 13, 2025 · 1 comment

Comments

@misha-erm
Copy link

Bug report

Current Behavior

ref of Trigger components gets detached on every render. Noticed it when tried to use together with https://www.npmjs.com/package/react-intersection-observer. It affected perf a lot as this lib is very sensitive to ref callback calls

Expected behavior

Ref should be stable as component doesn't go anywhere

Reproducible example

https://codesandbox.io/p/sandbox/zpzpwh

Open the console and try clicking on the button. After every click ref gets re-attached

Suggested solution

Additional context

Your environment

Software Name(s) Version
Radix Package(s) radix-ui/tooltip 1.1.8
React n/a 19.0.0 (18.x affected as well)
Browser Brave 1.74.51
Assistive tech
Node n/a
npm/yarn
Operating System
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

No branches or pull requests

2 participants