Skip to content

Commit 438f110

Browse files
committed
Restore profiling guards for _children
1 parent 0052b76 commit 438f110

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

packages/react-client/src/ReactFlightClient.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,11 +1427,13 @@ function parseModelString(
14271427
// Lazy node
14281428
const id = parseInt(value.slice(2), 16);
14291429
const chunk = getChunk(response, id);
1430-
if (
1431-
initializingChunk !== null &&
1432-
isArray(initializingChunk._children)
1433-
) {
1434-
initializingChunk._children.push(chunk);
1430+
if (enableProfilerTimer && enableComponentPerformanceTrack) {
1431+
if (
1432+
initializingChunk !== null &&
1433+
isArray(initializingChunk._children)
1434+
) {
1435+
initializingChunk._children.push(chunk);
1436+
}
14351437
}
14361438
// We create a React.lazy wrapper around any lazy values.
14371439
// When passed into React, we'll know how to suspend on this.
@@ -1445,11 +1447,13 @@ function parseModelString(
14451447
}
14461448
const id = parseInt(value.slice(2), 16);
14471449
const chunk = getChunk(response, id);
1448-
if (
1449-
initializingChunk !== null &&
1450-
isArray(initializingChunk._children)
1451-
) {
1452-
initializingChunk._children.push(chunk);
1450+
if (enableProfilerTimer && enableComponentPerformanceTrack) {
1451+
if (
1452+
initializingChunk !== null &&
1453+
isArray(initializingChunk._children)
1454+
) {
1455+
initializingChunk._children.push(chunk);
1456+
}
14531457
}
14541458
return chunk;
14551459
}

0 commit comments

Comments
 (0)