[Devtools]Fixed incorrect highlights components when filtered parent re-mounts …#36406
Open
Biki-das wants to merge 1 commit intofacebook:mainfrom
Open
[Devtools]Fixed incorrect highlights components when filtered parent re-mounts …#36406Biki-das wants to merge 1 commit intofacebook:mainfrom
Biki-das wants to merge 1 commit intofacebook:mainfrom
Conversation
Contributor
Author
|
cc @hoxyq |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
keychange or aconditional render), React creates fresh fibers for its children — those
children have
alternate === nullbecause they are being mounted, notupdated. 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.
didFiberRenderpreviously returnedtruefor any class / function /forwardRef / memo fiber whose
PerformedWorkflag was set, which is trueon first mount. This change short-circuits to
falsewhen the fiber hasno 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