-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
Add styles
and render
as dependencies for the position calculation effect
#994
Conversation
use a structural compare? |
That could be an alternative, but at that point I'd rather leave it to the user to check themselves. Btw, I thought this would fix #993 but I overlooked the fact you're using the |
styles
as dependency for the position calculation effectstyles
and render
as dependencies for the position calculation effect
Test with This solution feels a bit cumbersome with having to forward the ref to the custom component, but not sure if there are any other viable ways of achieving this. |
758bbd6
to
223b78d
Compare
223b78d
to
a208029
Compare
Worked like a charm - thanks for fixing this so quickly! |
that's actually a great idea. I'll try it out whenever i get the time |
With @akraines thanks for the great tips. I believe using the wrapper shouldn't be a problem in 99% of cases, we'll see what we can do if it ever causes any issues. Also you mentioning As soon as @danielbarion reviews it, we'll merge and do an official release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me :)
Nice and clean. Thank you very much for taking the time to fix this |
Closes #993.
A down side might be that if styles is passed inline like this:
since the
styles
object will change on every render, the tooltip will recalculate its position on every render.That doesn't seem like a big deal, but is there a smart way to avoid this, besides forcing the user to wrap the object with
useMemo()
or something similar?https://stackblitz.com/edit/react-ts-rtgmca
styles
as a dependency for the calculationrender
prop