Browse Source

fix(beta): typo on renderToReadableStream assetMap (#5621)

main
Marcos Bérgamo 2 years ago
committed by GitHub
parent
commit
b0ccb47f33
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      beta/src/content/reference/react-dom/server/renderToReadableStream.md

4
beta/src/content/reference/react-dom/server/renderToReadableStream.md

@ -167,7 +167,7 @@ const assetMap = {
async function handler(request) {
const stream = await renderToReadableStream(<App assetMap={assetMap} />, {
bootstrapScripts: [assets['/main.js']]
bootstrapScripts: [assetMap['/main.js']]
});
return new Response(stream, {
headers: { 'content-type': 'text/html' },
@ -188,7 +188,7 @@ async function handler(request) {
const stream = await renderToReadableStream(<App assetMap={assetMap} />, {
// Careful: It's safe to stringify() this because this data isn't user-generated.
bootstrapScriptContent: `window.assetMap = ${JSON.stringify(assetMap)};`,
bootstrapScripts: [assets['/main.js']],
bootstrapScripts: [assetMap['/main.js']],
});
return new Response(stream, {
headers: { 'content-type': 'text/html' },

Loading…
Cancel
Save