Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4f53362

Browse files
authored
Remove static markup from NodeStreamRenderer
The API docs did not match the actual behaviour. htmlStart & htmlEnd should be variables that can be passed to the function, currently they are static defined in the function.
1 parent 3ecacab commit 4f53362

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

‎src/server/ReactDOMNodeStreamRenderer.js‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,7 @@ function originalRenderToNodeStream(element, cache, streamingStart, memLife=0) {
9999
return new ReactMarkupReadableStream(element, false, cache, streamingStart, memLife);
100100
}
101101

102-
export function renderToNodeStream(element, cache, res) {
103-
104-
const htmlStart =
105-
'<html><head><title>Page</title></head><body><div id="react-root">';
106-
107-
const htmlEnd = '</div></body></html>';
102+
export function renderToNodeStream(element, cache, res, htmlStart, htmlEnd) {
108103

109104
const streamingStart = {
110105
sliceStartCount: htmlStart.length,
@@ -131,11 +126,7 @@ function originalRenderToStaticNodeStream(element, cache, streamingStart, memLif
131126
return new ReactMarkupReadableStream(element, true, cache, streamingStart, memLife);
132127
}
133128

134-
export function renderToStaticNodeStream(element, cache, res) {
135-
const htmlStart =
136-
'<html><head><title>Page</title></head><body><div id="react-root">';
137-
138-
const htmlEnd = '</div></body></html>';
129+
export function renderToStaticNodeStream(element, cache, res, htmlStart, htmlEnd) {
139130

140131
const streamingStart = {
141132
sliceStartCount: htmlStart.length,

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /