[DevTools] Fix: Trace Updates incorrectly highlights components when filtered parent re-mounts them#417
[DevTools] Fix: Trace Updates incorrectly highlights components when filtered parent re-mounts them#417everettbu wants to merge 1 commit into
Conversation
…iltered parent re-mounts them
Greptile SummaryFixes a bug where DevTools incorrectly highlights components in trace updates when a filtered parent re-mounts them. The fix adds an
Confidence Score: 5/5
Important Files Changed
|
There was a problem hiding this comment.
Additional Comments (1)
-
packages/react-devtools-shared/src/backend/fiber/renderer.js, line 2120-2127 (link)style: The default case doesn't check
alternate === null, so host components and other types could potentially be incorrectly highlighted on mount. Consider adding the same check here if this case can also encounter mounts.
1 file reviewed, 1 comment
|
This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated. |
|
Closing this pull request after a prolonged period of inactivity. If this issue is still present in the latest release, please ask for this pull request to be reopened. Thank you! |
Mirror of facebook/react#35618
Original author: youaresoyoung
Summary
Bug:
When "Hide DOM nodes" filter is enabled, updating a sibling component incorrectly highlights unrelated components that share a filtered parent.
Root Cause:
didFiberRender()only checks thePerformedWorkflag but doesn't verify if the fiber is a mount vs update. When DevTools re-mounts components after their filtered parent changes, they havePerformedWork=true+alternate=nullcausing them to be incorrectly marked as "rendered".Fix:
Add
alternatecheck indidFiberRender(). Ifalternate === null, the fiber is a mount (not an update) and should not be highlighted in trace updates.Before
before.mov
After
after.mov