@@ -66,7 +66,7 @@ import {
66
66
} from './ReactChildFiber' ;
67
67
import { processUpdateQueue } from './ReactUpdateQueue' ;
68
68
import { NoWork , Never } from './ReactFiberExpirationTime' ;
69
- import { ConcurrentMode , StrictMode } from './ReactTypeOfMode' ;
69
+ import { ConcurrentMode , ProfileMode , StrictMode } from './ReactTypeOfMode' ;
70
70
import {
71
71
shouldSetTextContent ,
72
72
shouldDeprioritizeSubtree ,
@@ -753,7 +753,7 @@ function mountLazyComponent(
753
753
) {
754
754
if ( _current !== null ) {
755
755
// An lazy component only mounts if it suspended inside a non-
756
- // concurrent tree, in an inconsistent state. We want to tree it like
756
+ // concurrent tree, in an inconsistent state. We want to treat it like
757
757
// a new mount, even though an empty version of it already committed.
758
758
// Disconnect the alternate pointers.
759
759
_current . alternate = null ;
@@ -839,7 +839,7 @@ function mountIncompleteClassComponent(
839
839
) {
840
840
if ( _current !== null ) {
841
841
// An incomplete component only mounts if it suspended inside a non-
842
- // concurrent tree, in an inconsistent state. We want to tree it like
842
+ // concurrent tree, in an inconsistent state. We want to treat it like
843
843
// a new mount, even though an empty version of it already committed.
844
844
// Disconnect the alternate pointers.
845
845
_current . alternate = null ;
@@ -896,7 +896,7 @@ function mountIndeterminateComponent(
896
896
) {
897
897
if ( _current !== null ) {
898
898
// An indeterminate component only mounts if it suspended inside a non-
899
- // concurrent tree, in an inconsistent state. We want to tree it like
899
+ // concurrent tree, in an inconsistent state. We want to treat it like
900
900
// a new mount, even though an empty version of it already committed.
901
901
// Disconnect the alternate pointers.
902
902
_current . alternate = null ;
@@ -1234,6 +1234,15 @@ function updateSuspenseComponent(
1234
1234
NoWork ,
1235
1235
null ,
1236
1236
) ;
1237
+
1238
+ if ( enableProfilerTimer && workInProgress . mode & ProfileMode ) {
1239
+ // Fiber treeBaseDuration must be at least as large as the sum of children treeBaseDurations.
1240
+ // Otherwise the profiler's onRender metrics will be off,
1241
+ // and the DevTools Profiler flamegraph will visually break as well.
1242
+ primaryChildFragment . treeBaseDuration =
1243
+ currentPrimaryChild . treeBaseDuration ;
1244
+ }
1245
+
1237
1246
primaryChildFragment . effectTag |= Placement ;
1238
1247
primaryChildFragment . child = currentPrimaryChild ;
1239
1248
currentPrimaryChild . return = primaryChildFragment ;
0 commit comments