Skip to content

[Devtools]Fixed incorrect highlights components when filtered parent re-mounts …#36406

Open
Biki-das wants to merge 1 commit intofacebook:mainfrom
Biki-das:devtools-fix
Open

[Devtools]Fixed incorrect highlights components when filtered parent re-mounts …#36406
Biki-das wants to merge 1 commit intofacebook:mainfrom
Biki-das:devtools-fix

Conversation

@Biki-das
Copy link
Copy Markdown
Contributor

@Biki-das Biki-das commented May 4, 2026

Summary

Fixes incorrect highlight outlines drawn on components when one of their
ancestors is hidden via component filters and that ancestor re-mounts.

When a filtered parent re-mounts (for example, due to a key change or a
conditional render), React creates fresh fibers for its children — those
children have alternate === null because they are being mounted, not
updated. From DevTools' perspective the parent is invisible, so the user
sees the children flash a highlight box as if they re-rendered for no
reason.

didFiberRender previously returned true for any class / function /
forwardRef / memo fiber whose PerformedWork flag was set, which is true
on first mount. This change short-circuits to false when the fiber has
no alternate, so initial mounts are no longer reported as "rendered" by
the highlight overlay or the Profiler change-tracking path.

How did you test this change?

Tested using devtools

Before

before.mov

After

after.mov

@meta-cla meta-cla Bot added the CLA Signed label May 4, 2026
@Biki-das
Copy link
Copy Markdown
Contributor Author

Biki-das commented May 4, 2026

cc @hoxyq

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant