Skip to content

Commit 9fec565

Browse files
authored
fix: log renders from passive effects for only newly finished work (facebook#33797)
This fixes displaying incorrect component render entries on a timeline, when we are reconnecting passive effects. ### Before <img width="2318" height="1127" alt="1" src="https://github.com/user-attachments/assets/9b6b2824-d2de-43a3-8615-2c45d67c3668" /> The cloned nodes will persist original `actualStartTime`, when these were first mounted. When we "replay", the end time will be "now" or whatever the actual start time of the sibling. Depending on when this is being recorded, the diff between end and start could be tens of seconds and doesn't represent what React was doing. We shouldn't log these entries at all. ### After We are only logging newly finished renders, but could potentially loose renders that never commit.
1 parent 996d0eb commit 9fec565

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/react-reconciler/src/ReactFiberCommitWork.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4155,6 +4155,7 @@ export function reconnectPassiveEffects(
41554155
if (
41564156
enableProfilerTimer &&
41574157
enableComponentPerformanceTrack &&
4158+
includeWorkInProgressEffects &&
41584159
(finishedWork.mode & ProfileMode) !== NoMode &&
41594160
((finishedWork.actualStartTime: any): number) > 0 &&
41604161
(finishedWork.flags & PerformedWork) !== NoFlags

0 commit comments

Comments
 (0)