Skip to content

Commit 3366146

Browse files
authored
Fix Failed to execute 'measure' on 'Performance' error (#32823)
When `startTime` still has its initial value of `-1.1` we must not call `logComponentMount`. This can occur when rendering a `'next/dynamic'` component with `{ssr: false}` in a client component, for example. Unfortunately, I didn't manage to reproduce this scenario in a unit test.
1 parent 365c031 commit 3366146

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react-reconciler/src/ReactFiberCommitWork.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3756,7 +3756,7 @@ function commitPassiveMountOnFiber(
37563756
) {
37573757
// Log the reappear in the render phase.
37583758
const startTime = ((finishedWork.actualStartTime: any): number);
3759-
if (endTime - startTime > 0.05) {
3759+
if (startTime >= 0 && endTime - startTime > 0.05) {
37603760
logComponentReappeared(finishedWork, startTime, endTime);
37613761
}
37623762
if (
@@ -3861,7 +3861,7 @@ function commitPassiveMountOnFiber(
38613861
if (isMount) {
38623862
// Log the mount in the render phase.
38633863
const startTime = ((finishedWork.actualStartTime: any): number);
3864-
if (endTime - startTime > 0.05) {
3864+
if (startTime >= 0 && endTime - startTime > 0.05) {
38653865
logComponentMount(finishedWork, startTime, endTime);
38663866
}
38673867
}

0 commit comments

Comments
 (0)