Skip to content

[DevTools] Fix false-positive re-render reports for filtered nodes#35723

Merged
hoxyq merged 1 commit intomainfrom
devtools/fix-rerender-false-positives
Feb 9, 2026
Merged

[DevTools] Fix false-positive re-render reports for filtered nodes#35723
hoxyq merged 1 commit intomainfrom
devtools/fix-rerender-false-positives

Conversation

@hoxyq
Copy link
Contributor

@hoxyq hoxyq commented Feb 8, 2026

Fixes #33423
Fixes #35245
Fixes #19732

As demoed here, React DevTools incorrectly highlights re-renders for descendants of filtered-out nodes that didn't actually render.

There were multiple fixes suggesting changes in didFiberRender() function, but these doesn't seem right, because this function is used in a context of whether the Fiber actually rendered something (updated), not re-rendered compared to the previous Fiber.

Instead, this PR adds additional validation at callsites that either used for highlighting re-renders or capturing tree base durations and are relying on didFiberRender. I've also added a few tests that reproduce the failure scenario. Without the changes, the tests are failing.

@hoxyq hoxyq requested a review from eps1lon February 8, 2026 15:44
@meta-cla meta-cla bot added the CLA Signed label Feb 8, 2026
@hoxyq hoxyq force-pushed the devtools/fix-rerender-false-positives branch from 43795fe to 8b56aff Compare February 9, 2026 10:42
@hoxyq hoxyq merged commit 24f215c into main Feb 9, 2026
234 checks passed
@hoxyq hoxyq deleted the devtools/fix-rerender-false-positives branch February 9, 2026 20:39
github-actions bot pushed a commit that referenced this pull request Feb 9, 2026
…35723)

Fixes #33423,
#35245,
#19732.

As demoed
[here](#33423 (comment)),
React DevTools incorrectly highlights re-renders for descendants of
filtered-out nodes that didn't actually render.

There were multiple fixes suggesting changes in `didFiberRender()`
function, but these doesn't seem right, because this function is used in
a context of whether the Fiber actually rendered something (updated),
not re-rendered compared to the previous Fiber.

Instead, this PR adds additional validation at callsites that either
used for highlighting re-renders or capturing tree base durations and
are relying on `didFiberRender`. I've also added a few tests that
reproduce the failure scenario. Without the changes, the tests are
failing.

DiffTrain build for [24f215c](24f215c)
github-actions bot pushed a commit that referenced this pull request Feb 9, 2026
…35723)

Fixes #33423,
#35245,
#19732.

As demoed
[here](#33423 (comment)),
React DevTools incorrectly highlights re-renders for descendants of
filtered-out nodes that didn't actually render.

There were multiple fixes suggesting changes in `didFiberRender()`
function, but these doesn't seem right, because this function is used in
a context of whether the Fiber actually rendered something (updated),
not re-rendered compared to the previous Fiber.

Instead, this PR adds additional validation at callsites that either
used for highlighting re-renders or capturing tree base durations and
are relying on `didFiberRender`. I've also added a few tests that
reproduce the failure scenario. Without the changes, the tests are
failing.

DiffTrain build for [24f215c](24f215c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants