-
Notifications
You must be signed in to change notification settings - Fork 842
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
EuiIconClass re-rendering issue #6159
Comments
Pinging @chandlerprall on this one as he's currently looking at EuiIcon for an unrelated issue, and render/perf is also up his alley |
I've confirmed a simple case (Logo component above) with no changing props does re-render EuiIcon when the owning component renders. Looking into why. |
@chandlerprall I just tested A few suspects from my use case: |
|
@constancecchen any ideas when this fix would be released? |
Almost certainly next Tuesday! (Our normal weekly release cadence) |
I'm working on an app that has an area where users can drag nodes around. At some point, we had performance issues and I had to debug the application by isolating each component. It turns out that some Eui components were being re-rendered unnecessarily.
I used why-did-you-render to look into what components were re-rendering and found out that
EuiIconClass
causes re-renders for no apparent reason. Really weird to see this, as no data is flowing to that component.WDYR states the reason as "props changes" and "different objects that are equal by value." Props received are
theme.colorMode: "DARK"
,theme.euiTheme: {"themeName": "EUI_THEME_AMSTERDAM", ...
,theme.modifications: {}
I obviously want to prevent re-renders, not sure if it's about something the way
EuiIconClass
was structured or the way I'm using Eui in general. Appreciate any help resolving this problem.This is basically how I use Eui:
Main Component:
A simple example from Header, this would cause a re-render each time.
the EuiIconClass
reported by WDYR is contained within other components and it's almost impossible to replace it to get rid of the problem even if I wanted to do that.Any thoughts or ideas? Thanks in advance!
The text was updated successfully, but these errors were encountered: