diff --git a/packages/react-server/src/ReactFlightServer.js b/packages/react-server/src/ReactFlightServer.js index aefcf5f6ee8..0fcd8af7cbc 100644 --- a/packages/react-server/src/ReactFlightServer.js +++ b/packages/react-server/src/ReactFlightServer.js @@ -2302,6 +2302,9 @@ function renderModel( key: string, value: ReactClientValue, ): ReactJSONValue { + // First time we're serializing the key, we should add it to the size. + serializedSize += key.length; + const prevKeyPath = task.keyPath; const prevImplicitSlot = task.implicitSlot; try { @@ -2416,8 +2419,6 @@ function renderModelDestructive( // Set the currently rendering model task.model = value; - serializedSize += parentPropertyName.length; - // Special Symbol, that's very common. if (value === REACT_ELEMENT_TYPE) { return '$';