From a3010b5b274499e340b1b3d3f0d2740054883f1a Mon Sep 17 00:00:00 2001 From: Sebastian Markbage Date: Mon, 13 Oct 2025 23:58:30 -0400 Subject: [PATCH] Look for moved debugInfo when logging component performance track --- .../react-client/src/ReactFlightClient.js | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/react-client/src/ReactFlightClient.js b/packages/react-client/src/ReactFlightClient.js index 701d9df33cdd9..2121903b87e47 100644 --- a/packages/react-client/src/ReactFlightClient.js +++ b/packages/react-client/src/ReactFlightClient.js @@ -4318,7 +4318,26 @@ function flushComponentPerformance( // First find the start time of the first component to know if it was running // in parallel with the previous. - const debugInfo = __DEV__ && root._debugInfo; + let debugInfo = null; + if (__DEV__) { + debugInfo = root._debugInfo; + if (debugInfo.length === 0 && root.status === 'fulfilled') { + const resolvedValue = resolveLazy(root.value); + if ( + typeof resolvedValue === 'object' && + resolvedValue !== null && + (isArray(resolvedValue) || + typeof resolvedValue[ASYNC_ITERATOR] === 'function' || + resolvedValue.$$typeof === REACT_ELEMENT_TYPE || + resolvedValue.$$typeof === REACT_LAZY_TYPE) && + isArray(resolvedValue._debugInfo) + ) { + // It's possible that the value has been given the debug info. + // In that case we need to look for it on the resolved value. + debugInfo = resolvedValue._debugInfo; + } + } + } if (debugInfo) { let startTime = 0; for (let i = 0; i < debugInfo.length; i++) {