@@ -2460,7 +2460,6 @@ function initializeFakeStack(
2460
2460
const stack = debugInfo.stack;
2461
2461
const env = debugInfo.env == null ? '' : debugInfo.env;
2462
2462
// $FlowFixMe[cannot-write]
2463
- // $FlowFixMe[prop-missing]
2464
2463
debugInfo.debugStack = createFakeJSXCallStackInDEV(response, stack, env);
2465
2464
}
2466
2465
if (debugInfo.owner != null) {
@@ -2488,12 +2487,14 @@ function resolveDebugInfo(
2488
2487
debugInfo.env === undefined ? response._rootEnvironmentName : debugInfo.env;
2489
2488
initializeFakeTask(response, debugInfo, env);
2490
2489
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;
2493
2494
// We override the stack if we override the owner since the stack where the root JSX
2494
2495
// 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;
2497
2498
} else {
2498
2499
initializeFakeStack(response, debugInfo);
2499
2500
}
0 commit comments