Skip to content

Commit

Permalink
More type-safety
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon authored and sebmarkbage committed Jun 11, 2024
1 parent 89bf5f9 commit b452d4d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/react-server/src/ReactFlightServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1054,13 +1054,12 @@ function renderFunctionComponent<Props>(
request.pendingChunks++;

const componentDebugID = debugID;
componentDebugInfo = {
componentDebugInfo = ({
name: componentName,
env: request.environmentName,
owner: owner,
};
}: ReactComponentInfo);
if (enableOwnerStacks) {
// $FlowFixMe[prop-missing]
// $FlowFixMe[cannot-write]
componentDebugInfo.stack = stack;
}
Expand Down Expand Up @@ -2490,15 +2489,16 @@ function renderModelDestructive(
) {
// This looks like a ReactComponentInfo. We can't serialize the ConsoleTask object so we
// need to omit it before serializing.
const componentDebugInfo = {
const componentDebugInfo: Omit<ReactComponentInfo, 'task'> = {
name: value.name,
env: value.env,
owner: value.owner,
owner: (value: any).owner,
};
if (enableOwnerStacks) {
(componentDebugInfo: any).stack = (value: any).stack;
// $FlowFixMe[cannot-write]
componentDebugInfo.stack = (value: any).stack;
}
return (componentDebugInfo: any);
return componentDebugInfo;
}

if (objectName(value) !== 'Object') {
Expand Down

0 comments on commit b452d4d

Please sign in to comment.