Skip to content

Commit

Permalink
Narrowed FlowFixMe
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Dec 9, 2024
1 parent 90abb21 commit ebcf192
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/react-client/src/ReactFlightClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -2460,7 +2460,6 @@ function initializeFakeStack(
const stack = debugInfo.stack;
const env = debugInfo.env == null ? '' : debugInfo.env;
// $FlowFixMe[cannot-write]
// $FlowFixMe[prop-missing]
debugInfo.debugStack = createFakeJSXCallStackInDEV(response, stack, env);
}
if (debugInfo.owner != null) {
Expand Down Expand Up @@ -2488,12 +2487,14 @@ function resolveDebugInfo(
debugInfo.env === undefined ? response._rootEnvironmentName : debugInfo.env;
initializeFakeTask(response, debugInfo, env);
if (debugInfo.owner === null && response._debugRootOwner != null) {
// $FlowFixMe
debugInfo.owner = response._debugRootOwner;
// $FlowFixMe[prop-missing] By narrowing `owner` to `null`, we narrowed `debugInfo` to `ReactComponentInfo`
const componentInfo: ReactComponentInfo = debugInfo;
// $FlowFixMe[cannot-write]
componentInfo.owner = response._debugRootOwner;
// We override the stack if we override the owner since the stack where the root JSX
// was created on the server isn't very useful but where the request was made is.
// $FlowFixMe
debugInfo.debugStack = response._debugRootStack;
// $FlowFixMe[cannot-write]
componentInfo.debugStack = response._debugRootStack;
} else {
initializeFakeStack(response, debugInfo);
}
Expand Down

0 comments on commit ebcf192

Please sign in to comment.