Skip to content

Commit f9e1b16

Browse files
authored
Avoid double logging component render time (facebook#32749)
This got moved into the functional component and class component case statements here: facebook@0de1233. So that we could separate the error case for class components. However, due to a faulty rebase this got restored at the top as well. Leading to double component renders being logged. In the other offscreen reconnect passes we don't do this in each case statement but still once at the top. The reason this doesn't matter is because use the PerformedWork flag and that is only set for function and class components. Although maybe it should be set for expensive DOM components too and then we have to remember this.
1 parent 4845e16 commit f9e1b16

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

packages/react-reconciler/src/ReactFiberCommitWork.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3095,25 +3095,6 @@ function commitPassiveMountOnFiber(
30953095
const prevEffectStart = pushComponentEffectStart();
30963096
const prevEffectErrors = pushComponentEffectErrors();
30973097

3098-
// If this component rendered in Profiling mode (DEV or in Profiler component) then log its
3099-
// render time. We do this after the fact in the passive effect to avoid the overhead of this
3100-
// getting in the way of the render characteristics and avoid the overhead of unwinding
3101-
// uncommitted renders.
3102-
if (
3103-
enableProfilerTimer &&
3104-
enableComponentPerformanceTrack &&
3105-
(finishedWork.mode & ProfileMode) !== NoMode &&
3106-
((finishedWork.actualStartTime: any): number) > 0 &&
3107-
(finishedWork.flags & PerformedWork) !== NoFlags
3108-
) {
3109-
logComponentRender(
3110-
finishedWork,
3111-
((finishedWork.actualStartTime: any): number),
3112-
endTime,
3113-
inHydratedSubtree,
3114-
);
3115-
}
3116-
31173098
const isViewTransitionEligible = enableViewTransition
31183099
? includesOnlyViewTransitionEligibleLanes(committedLanes)
31193100
: false;

0 commit comments

Comments
 (0)