Skip to content

Commit 77f4e2e

Browse files
committed
Hoist out creation for better inlining
The closures prevent inlining otherwise.
1 parent ea28946 commit 77f4e2e

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ type Controls = {|
4242
startWriting(): void,
4343
|};
4444

45-
function pipeToNodeWritable(
45+
function createRequestImpl(
4646
children: ReactNodeList,
4747
destination: Writable,
48-
options?: Options,
49-
): Controls {
50-
const request = createRequest(
48+
options: void | Options,
49+
) {
50+
return createRequest(
5151
children,
5252
destination,
5353
createResponseState(options ? options.identifierPrefix : undefined),
@@ -57,6 +57,14 @@ function pipeToNodeWritable(
5757
options ? options.onCompleteAll : undefined,
5858
options ? options.onReadyToStream : undefined,
5959
);
60+
}
61+
62+
function pipeToNodeWritable(
63+
children: ReactNodeList,
64+
destination: Writable,
65+
options?: Options,
66+
): Controls {
67+
const request = createRequestImpl(children, destination, options);
6068
let hasStartedFlowing = false;
6169
startWork(request);
6270
return {

0 commit comments

Comments
 (0)