diff --git a/packages/react-server/src/ReactServerStreamConfigNode.js b/packages/react-server/src/ReactServerStreamConfigNode.js index 807dafe5edf6e..15d503553be11 100644 --- a/packages/react-server/src/ReactServerStreamConfigNode.js +++ b/packages/react-server/src/ReactServerStreamConfigNode.js @@ -75,12 +75,11 @@ function writeStringChunk(destination: Destination, stringChunk: string) { writtenBytes += written; if (read < stringChunk.length) { - writeToDestination(destination, (currentView: any)); + writeToDestination(destination, (currentView: any).subarray(0, writtenBytes)); currentView = new Uint8Array(VIEW_SIZE); writtenBytes = textEncoder.encodeInto( stringChunk.slice(read), - // $FlowFixMe[incompatible-call] found when upgrading Flow - currentView, + (currentView: any), ).written; }