Skip to content

Commit b452d4d

Browse files
eps1lonsebmarkbage
authored andcommitted
More type-safety
1 parent 89bf5f9 commit b452d4d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/react-server/src/ReactFlightServer.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,13 +1054,12 @@ function renderFunctionComponent<Props>(
10541054
request.pendingChunks++;
10551055

10561056
const componentDebugID = debugID;
1057-
componentDebugInfo = {
1057+
componentDebugInfo = ({
10581058
name: componentName,
10591059
env: request.environmentName,
10601060
owner: owner,
1061-
};
1061+
}: ReactComponentInfo);
10621062
if (enableOwnerStacks) {
1063-
// $FlowFixMe[prop-missing]
10641063
// $FlowFixMe[cannot-write]
10651064
componentDebugInfo.stack = stack;
10661065
}
@@ -2490,15 +2489,16 @@ function renderModelDestructive(
24902489
) {
24912490
// This looks like a ReactComponentInfo. We can't serialize the ConsoleTask object so we
24922491
// need to omit it before serializing.
2493-
const componentDebugInfo = {
2492+
const componentDebugInfo: Omit<ReactComponentInfo, 'task'> = {
24942493
name: value.name,
24952494
env: value.env,
2496-
owner: value.owner,
2495+
owner: (value: any).owner,
24972496
};
24982497
if (enableOwnerStacks) {
2499-
(componentDebugInfo: any).stack = (value: any).stack;
2498+
// $FlowFixMe[cannot-write]
2499+
componentDebugInfo.stack = (value: any).stack;
25002500
}
2501-
return (componentDebugInfo: any);
2501+
return componentDebugInfo;
25022502
}
25032503

25042504
if (objectName(value) !== 'Object') {

0 commit comments

Comments
 (0)