From 03f24a3e6c9fe5d80139ff76424ad05ead51a381 Mon Sep 17 00:00:00 2001 From: Hirahara Date: Mon, 9 Nov 2026 12:36:31 +0900 Subject: [PATCH] Translate resumeToPipeableStream --- .../server/resumeToPipeableStream.md | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/content/reference/react-dom/server/resumeToPipeableStream.md b/src/content/reference/react-dom/server/resumeToPipeableStream.md index f80cf23fc..0585f840e 100644 --- a/src/content/reference/react-dom/server/resumeToPipeableStream.md +++ b/src/content/reference/react-dom/server/resumeToPipeableStream.md @@ -4,7 +4,7 @@ title: resumeToPipeableStream -`resumeToPipeableStream` streams a pre-rendered React tree to a pipeable [Node.js Stream.](https://nodejs.org/api/stream.html) +`resumeToPipeableStream` はプリレンダーされた React ツリーを、パイプ可能な [Node.js ストリーム](https://nodejs.org/api/stream.html)にストリーミングします。 ```js const {pipe, abort} = await resumeToPipeableStream(reactNode, postponedState, options?) @@ -16,17 +16,17 @@ const {pipe, abort} = await resumeToPipeableStream(reactNode, postponedState, op -This API is specific to Node.js. Environments with [Web Streams,](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API) like Deno and modern edge runtimes, should use [`resume`](/reference/react-dom/server/renderToReadableStream) instead. +この API は Node.js 専用です。Deno やモダンなエッジランタイムなどの [Web Stream](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API) を用いる環境では、[`resume`](/reference/react-dom/server/renderToReadableStream) を代わりに使用してください。 --- -## Reference {/*reference*/} +## リファレンス {/*reference*/} ### `resumeToPipeableStream(node, postponed, options?)` {/*resume-to-pipeable-stream*/} -Call `resumeToPipeableStream` to resume rendering a pre-rendered React tree as HTML into a [Node.js Stream.](https://nodejs.org/api/stream.html#writable-streams) +`resumeToPipeableStream` を呼び出して、プリレンダーされた React ツリーの HTML としてのレンダーを再開し、[Node.js ストリーム](https://nodejs.org/api/stream.html#writable-streams)に出力します。 ```js import { resumeToPipeableStream } from 'react-dom/server'; @@ -42,38 +42,38 @@ async function handler(request, response) { } ``` -[See more examples below.](#usage) +[さらに例を見る](#usage) -#### Parameters {/*parameters*/} +#### 引数 {/*parameters*/} -* `reactNode`: The React node you called `prerender` with. For example, a JSX element like ``. It is expected to represent the entire document, so the `App` component should render the `` tag. -* `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). -* **optional** `options`: An object with streaming options. - * **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). - * **optional** `onAllReady`: A callback that fires when all rendering is complete, including both the shell and all additional content. You can call `pipe` here instead of in `onShellReady` for crawlers and static generation. The stream will contain the final HTML. - * **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) - * **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`. - * **optional** `onShellReady`: A callback that fires right after the [shell](#specifying-what-goes-into-the-shell) has finished. You can call `pipe` here to start streaming. React will [stream the additional content](#streaming-more-content-as-it-loads) after the shell along with the inline `