We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f2b8db0 commit 001f830Copy full SHA for 001f830
packages/react-dom/src/server/ReactDOMLegacyServerStreamConfig.js
@@ -24,10 +24,21 @@ export function flushBuffered(destination: Destination) {}
24
25
export function beginWriting(destination: Destination) {}
26
27
+let prevWasCommentSegmenter = false;
28
export function writeChunk(
29
destination: Destination,
30
chunk: Chunk | PrecomputedChunk,
31
): boolean {
32
+ if (prevWasCommentSegmenter) {
33
+ prevWasCommentSegmenter = false;
34
+ if (chunk[0] !== '<') {
35
+ destination.push('<!-- -->');
36
+ }
37
38
+ if (chunk === '<!-- -->') {
39
+ prevWasCommentSegmenter = true;
40
+ return true;
41
42
return destination.push(chunk);
43
}
44
0 commit comments