Skip to content

Commit 4a8deb0

Browse files
authored
Switch the isPrimaryRender flag based on the stream config (#21357)
1 parent bd4f056 commit 4a8deb0

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

packages/react-dom/src/server/ReactDOMServerFormatConfig.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
writeChunk,
2424
stringToChunk,
2525
stringToPrecomputedChunk,
26+
isPrimaryStreamConfig,
2627
} from 'react-server/src/ReactServerStreamConfig';
2728

2829
import {
@@ -50,7 +51,7 @@ import isArray from 'shared/isArray';
5051

5152
// Used to distinguish these contexts from ones used in other renderers.
5253
// E.g. this can be used to distinguish legacy renderers from this modern one.
53-
export const isPrimaryRenderer = true;
54+
export const isPrimaryRenderer = isPrimaryStreamConfig;
5455

5556
// Per response, global state that is not contextual to the rendering subtree.
5657
export type ResponseState = {

packages/react-server/src/ReactServerStreamConfigBrowser.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ export type Destination = ReadableStreamController;
1212
export type PrecomputedChunk = Uint8Array;
1313
export type Chunk = Uint8Array;
1414

15+
export const isPrimaryStreamConfig = true;
16+
1517
export function scheduleWork(callback: () => void) {
1618
callback();
1719
}

packages/react-server/src/ReactServerStreamConfigNode.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ export type Destination = Writable & MightBeFlushable;
2121
export type PrecomputedChunk = Uint8Array;
2222
export type Chunk = string;
2323

24+
export const isPrimaryStreamConfig = true;
25+
2426
export function scheduleWork(callback: () => void) {
2527
setImmediate(callback);
2628
}

0 commit comments

Comments
 (0)