dillon1000/react
Commit
Browse files [DevTools] Fix false-positive re-render reports for filtered nodes (#35723)
Fixes https://github.com/facebook/react/issues/33423, https://github.com/facebook/react/issues/35245, https://github.com/facebook/react/issues/19732. As demoed [here](https://github.com/facebook/react/issues/33423#issuecomment-2970750588), 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.
Changed paths2 files
First-parent comparisonpackages/react-devtools-shared/src/__tests__/profilingCharts-test.js ModifiedM packages/react-devtools-shared/src/backend/fiber/renderer.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…