Skip to content

Commit 21db19f

Browse files
committed
Pass the destination to startWriting instead of renderToNode
1 parent 844067c commit 21db19f

File tree

8 files changed

+80
-121
lines changed

8 files changed

+80
-121
lines changed

fixtures/flight/server/handler.server.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ module.exports = function(req, res) {
2222
const moduleMap = JSON.parse(data);
2323
const {startWriting} = renderToNodePipe(
2424
React.createElement(App),
25-
res,
2625
moduleMap
2726
);
28-
startWriting();
27+
startWriting(res);
2928
}
3029
);
3130
});

fixtures/ssr/server/render.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ export default function render(url, res) {
2020
console.error('Fatal', error);
2121
});
2222
let didError = false;
23-
const {startWriting, abort} = renderToNodePipe(<App assets={assets} />, res, {
23+
const {startWriting, abort} = renderToNodePipe(<App assets={assets} />, {
2424
onCompleteShell() {
2525
// If something errored before we started streaming, we set the error code appropriately.
2626
res.statusCode = didError ? 500 : 200;
2727
res.setHeader('Content-type', 'text/html');
28-
startWriting();
28+
startWriting(res);
2929
},
3030
onError(x) {
3131
didError = true;

fixtures/ssr2/server/render.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,12 @@ module.exports = function render(url, res) {
4141
<DataProvider data={data}>
4242
<App assets={assets} />
4343
</DataProvider>,
44-
res,
4544
{
4645
onCompleteShell() {
4746
// If something errored before we started streaming, we set the error code appropriately.
4847
res.statusCode = didError ? 500 : 200;
4948
res.setHeader('Content-type', 'text/html');
50-
startWriting();
49+
startWriting(res);
5150
},
5251
onError(x) {
5352
didError = true;

0 commit comments

Comments
 (0)