You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7c0d102
Browse filesBrowse the repository at this point in the historyBrowse files
This API depends on [Web Streams.](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API) For Node.js, use [`resumeToNodeStream`](/reference/react-dom/server/renderToPipeableStream) instead.
19
+
この API は [Web Streams](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API) に依存しています。Node.js では、代わりに [`resumeToNodeStream`](/reference/react-dom/server/renderToPipeableStream) を使用してください。
Call `resume`to resume rendering a pre-rendered React tree as HTML into a [Readable Web Stream.](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream)
29
+
`resume`を呼び出して、プリレンダーされた React ツリーの HTML としてのレンダーを再開し、[読み取り可能な Web Stream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream) に出力します。
30
30
31
31
```js
32
32
import { resume } from'react-dom/server';
@@ -39,40 +39,40 @@ async function handler(request, writable) {
39
39
}
40
40
```
41
41
42
-
[See more examples below.](#usage)
42
+
[さらに例を見る](#usage)
43
43
44
-
#### Parameters {/*parameters*/}
44
+
#### 引数 {/*parameters*/}
45
45
46
-
* `reactNode`: The React node you called `prerender`with. For example, a JSX element like `<App />`. It is expected to represent the entire document, so the `App`component should render the `<html>`tag.
47
-
* `postponedState`: The opaque `postpone` object returned from a [prerender API](/reference/react-dom/static/index), loaded from wherever you stored it (e.g. redis, a file, or S3).
48
-
* **optional** `options`: An object with streaming options.
49
-
* **optional** `nonce`: A [`nonce`](http://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#nonce) string to allow scripts for [`script-src` Content-Security-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src).
50
-
* **optional** `signal`: An [abort signal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that lets you [abort server rendering](#aborting-server-rendering) and render the rest on the client.
51
-
* **optional** `onBrowserBailout`: A callback React calls when it recovers from [`browser()`](/reference/react-dom/browser) by leaving a Suspense fallback for the browser to replace. It receives an `Error`describing the browser-only render and an `errorInfo` object containing the `componentStack`. If a reason was passed to `browser`, it is available as `error.cause`. By default, React does nothing. [See how to report browser-only rendering.](/reference/react-dom/browser#reporting-browser-only-rendering-on-the-server)
52
-
* **optional** `onError`: A callback that fires whenever there is a server error, whether [recoverable](/reference/react-dom/server/renderToReadableStream#recovering-from-errors-outside-the-shell) or [not.](/reference/react-dom/server/renderToReadableStream#recovering-from-errors-inside-the-shell) By default, this only calls `console.error`. If you override it to [log crash reports,](/reference/react-dom/server/renderToReadableStream#logging-crashes-on-the-server) make sure that you still call `console.error`.
- If `resume`successfully produced a [shell](/reference/react-dom/server/renderToReadableStream#specifying-what-goes-into-the-shell), that Promise will resolve to a [Readable Web Stream.](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream) that can be piped to a [Writable Web Stream.](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream).
60
-
- If an error happens in the shell, the Promise will reject with that error.
59
+
- `resume`が[シェル](/reference/react-dom/server/renderToReadableStream#specifying-what-goes-into-the-shell)の生成に成功した場合、Promise は[書き込み可能な Web Stream](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream) にパイプできる[読み取り可能な Web Stream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream) に解決 (resolve) されます。
60
+
- シェルでエラーが発生した場合、Promise はそのエラーで拒否 (reject) されます。
61
61
62
-
The returned stream has an additional property:
62
+
返されるストリームには追加のプロパティがあります。
63
63
64
-
* `allReady`: A Promise that resolves when all rendering is complete. You can `awaitstream.allReady` before returning a response [for crawlers and static generation.](/reference/react-dom/server/renderToReadableStream#waiting-for-all-content-to-load-for-crawlers-and-static-generation) If you do that, you won't get any progressive loading. The stream will contain the final HTML.
64
+
* `allReady`: すべてのレンダーが完了したときに解決される Promise。[クローラや静的生成向け](/reference/react-dom/server/renderToReadableStream#waiting-for-all-content-to-load-for-crawlers-and-static-generation)の場合、レスポンスを返す前に `stream.allReady` を await できます。これを行うとプログレッシブなローディングがなくなり、ストリームには最終的な HTML が含まれるようになります。
65
65
66
-
#### Caveats {/*caveats*/}
66
+
#### 注意点 {/*caveats*/}
67
67
68
-
- `resume`does not accept options for `bootstrapScripts`, `bootstrapScriptContent`, or `bootstrapModules`. Instead, you need to pass these options to the `prerender` call that generates the `postponedState`. You can also inject bootstrap content into the writable stream manually.
69
-
- `resume`does not accept `identifierPrefix`since the prefix needs to be the same in both `prerender`and`resume`.
70
-
- Since`nonce`cannot be provided to prerender, you should only provide `nonce` to `resume` if you're not providing scripts to prerender.
71
-
- `resume`re-renders from the root until it finds a component that was not fully pre-rendered. Only fully prerendered Components (the Component and its children finished prerendering) are skipped entirely.
### Resuming a prerender {/*resuming-a-prerender*/}
75
+
### プリレンダーの再開 {/*resuming-a-prerender*/}
76
76
77
77
<Sandpack>
78
78
@@ -239,7 +239,7 @@ export function sleep(timeoutMS) {
239
239
240
240
</Sandpack>
241
241
242
-
### Further reading {/*further-reading*/}
242
+
### さらに学ぶ {/*further-reading*/}
243
243
244
-
Resuming behaves like `renderToReadableStream`. For more examples, check out the [usage section of `renderToReadableStream`](/reference/react-dom/server/renderToReadableStream#usage).
245
-
The [usage section of `prerender`](/reference/react-dom/static/prerender#usage) includes examples of how to use `prerender` specifically.
0 commit comments