-
Notifications
You must be signed in to change notification settings - Fork 852
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
[Tooltip] Wrapping the app in TooltipProvider causes every single tooltip to re-render on hover #2375
Comments
bump? |
Oh wow, we also just ran into this. Does this mean that we need to be wrapping every single |
Based on the Profiler highlight,
Hence, the Provider is pretty similar to how That also means, the following case can cause excessive re-renders, where you have a local Tooltip Provider that wraps lots of small items. For example, a calendar panel. That the total size of the But you can't always make the conclusion based on the dev-tools highlight, always need to measure, the render might be cheap. |
ran into the same thing, this should be mentioned in the docs. |
Here is a patch that fixes the issue The trick is to use Our app has tons of elements with tooltips on screen so the issue was quite critical for us. After the change only one element re-renders on hover
|
Do you have plan to merge this? Still happening |
I have same issue |
bump |
bump x2 |
Bug report
Current Behavior
When wrapping the app in Tooltip provider, every single component that implements a tooltip gets re-rendered on hovering any of the components that implement a tooltip, even if nothing changes, causing excessive re-renders.
Expected behavior
Only components with an active tooltip should be affected or when default settings change.
Reproducible example
Wrap an app in TooltipProvider and turn on
Highlight updates when components render
in React devtools, and then hover any component with a tooltip to notice that every component that implements a tooltip gets re-rendered.Suggested solution
Additional context
Your environment
The text was updated successfully, but these errors were encountered: