@@ -2460,7 +2460,6 @@ function initializeFakeStack(
24602460 const stack = debugInfo.stack;
24612461 const env = debugInfo.env == null ? '' : debugInfo.env;
24622462 // $FlowFixMe[cannot-write]
2463- // $FlowFixMe[prop-missing]
24642463 debugInfo.debugStack = createFakeJSXCallStackInDEV(response, stack, env);
24652464 }
24662465 if (debugInfo.owner != null) {
@@ -2488,12 +2487,14 @@ function resolveDebugInfo(
24882487 debugInfo.env === undefined ? response._rootEnvironmentName : debugInfo.env;
24892488 initializeFakeTask(response, debugInfo, env);
24902489 if (debugInfo.owner === null && response._debugRootOwner != null) {
2491- // $FlowFixMe
2492- debugInfo.owner = response._debugRootOwner;
2490+ // $FlowFixMe[prop-missing] By narrowing `owner` to `null`, we narrowed `debugInfo` to `ReactComponentInfo`
2491+ const componentInfo: ReactComponentInfo = debugInfo;
2492+ // $FlowFixMe[cannot-write]
2493+ componentInfo.owner = response._debugRootOwner;
24932494 // We override the stack if we override the owner since the stack where the root JSX
24942495 // was created on the server isn't very useful but where the request was made is.
2495- // $FlowFixMe
2496- debugInfo .debugStack = response._debugRootStack;
2496+ // $FlowFixMe[cannot-write]
2497+ componentInfo .debugStack = response._debugRootStack;
24972498 } else {
24982499 initializeFakeStack(response, debugInfo);
24992500 }
0 commit comments