Browse Source

Fix typo

main
dan 2 years ago
committed by GitHub
parent
commit
24a3e04e1a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      beta/src/content/apis/react-dom/server/renderToPipeableStream.md

4
beta/src/content/apis/react-dom/server/renderToPipeableStream.md

@ -139,7 +139,7 @@ const assetMap = {
app.use('/', (request, response) => {
const { pipe } = renderToPipeableStream(<App assetMap={assetMap} />, {
// Careful: It's safe to stringify() this because this data isn't user-generated.
bootstrapScriptContents: `window.assetMap = ${JSON.stringify(assetMap)};`,
bootstrapScriptContent: `window.assetMap = ${JSON.stringify(assetMap)};`,
bootstrapScripts: [assetMap['main.js']],
onShellReady() {
response.setHeader('content-type', 'text/html');
@ -149,7 +149,7 @@ app.use('/', (request, response) => {
});
```
In the example above, the `bootstrapScriptContents` option adds an extra inline `<script>` tag that sets the global `window.assetMap` variable on the client. This lets the client code read the same `assetMap`:
In the example above, the `bootstrapScriptContent` option adds an extra inline `<script>` tag that sets the global `window.assetMap` variable on the client. This lets the client code read the same `assetMap`:
```js {4}
import {hydrateRoot} from 'react-dom/client';

Loading…
Cancel
Save