-
Notifications
You must be signed in to change notification settings - Fork 185
Translate "hydrate" #653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translate "hydrate" #653
Changes from 2 commits
4ed5622
219d375
c0b7bc5
e465592
de82398
cfadc24
bcc86a8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -4,15 +4,15 @@ title: hydrate | |||||
|
|
||||||
| <Deprecated> | ||||||
|
|
||||||
| This API will be removed in a future major version of React. | ||||||
| この API は、今後のメジャーバージョンの React で削除される予定です。 | ||||||
|
|
||||||
| In React 18, `hydrate` was replaced by [`hydrateRoot`.](/reference/react-dom/client/hydrateRoot) Using `hydrate` in React 18 will warn that your app will behave as if it’s running React 17. Learn more [here.](/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis) | ||||||
| React 18 では、`hydrate` は [`hydrateRoot` に置き換えられました。](/reference/react-dom/client/hydrateRoot)React 18 で `hydrate` を使用すると、アプリは React 17 を実行しているかのような振る舞いになるとの警告が表示されます。詳細は[こちらをご覧ください。](/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis) | ||||||
|
|
||||||
| </Deprecated> | ||||||
|
|
||||||
| <Intro> | ||||||
|
|
||||||
| `hydrate` lets you display React components inside a browser DOM node whose HTML content was previously generated by [`react-dom/server`](/reference/react-dom/server) in React 17 and below. | ||||||
| `hydrate` を使用すると、React 17 以前で [`react-dom/server`](/reference/react-dom/server) によって以前に生成されたブラウザの DOM ノードの HTML コンテンツ内に React コンポーネントを表示できます。 | ||||||
|
|
||||||
| ```js | ||||||
| hydrate(reactNode, domNode, callback?) | ||||||
|
|
@@ -24,59 +24,59 @@ hydrate(reactNode, domNode, callback?) | |||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## Reference {/*reference*/} | ||||||
| ## リファレンス {/*reference*/} | ||||||
|
|
||||||
| ### `hydrate(reactNode, domNode, callback?)` {/*hydrate*/} | ||||||
|
|
||||||
| Call `hydrate` in React 17 and below to “attach” React to existing HTML that was already rendered by React in a server environment. | ||||||
| React 17 以前では、`hydrate` を呼び出して、サーバー環境で既に React がレンダーした既存の HTML に React を「アタッチ」します。 | ||||||
smikitky marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| ```js | ||||||
| import { hydrate } from 'react-dom'; | ||||||
|
|
||||||
| hydrate(reactNode, domNode); | ||||||
| ``` | ||||||
|
|
||||||
| React will attach to the HTML that exists inside the `domNode`, and take over managing the DOM inside it. An app fully built with React will usually only have one `hydrate` call with its root component. | ||||||
| React は、`domNode` 内に存在する HTML にアタッチし、その内部の DOM を管理します。React で完全に構築されたアプリは通常、ルートコンポーネントを持つ 1 つの `hydrate` 呼び出しのみを持ちます。 | ||||||
smikitky marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| [See more examples below.](#usage) | ||||||
| [さらに例を読む](#usage) | ||||||
smikitky marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| #### Parameters {/*parameters*/} | ||||||
| #### 引数 {/*parameters*/} | ||||||
|
|
||||||
| * `reactNode`: The "React node" used to render the existing HTML. This will usually be a piece of JSX like `<App />` which was rendered with a `ReactDOM Server` method such as `renderToString(<App />)` in React 17. | ||||||
| * `reactNode`: 既存の HTML をレンダーするのに使用される「React ノード」。これは通常、React 17 における `ReactDOM Server` のメソッド(例:`renderToString(<App />)`)でレンダーされた JSX の一部である`<App />`のようなものです。 | ||||||
|
||||||
| * `reactNode`: 既存の HTML をレンダーするのに使用される「React ノード」。これは通常、React 17 における `ReactDOM Server` のメソッド(例:`renderToString(<App />)`)でレンダーされた JSX の一部である`<App />`のようなものです。 | |
| * `reactNode`: HTML を事前レンダーするのに使用された「React ノード」。これは通常、React 17 における `ReactDOM Server` のメソッド(例:`renderToString(<App />)`)でレンダーされた JSX である `<App />` のようなものです。 |
この "piece of" は英文法的に必要なゴミみたいなものですので日本語では訳さないでいいかなと思います
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@riku929hr 偶然これを見つけたのでお答えしますと、この "piece of" は英語で不可算名詞を無理やり数えるときの表現です。受験英語的には "a piece of paper", "a piece of information" が有名で、特に後者は「情報の一部」ではなく単に「情報」とするか、「1 件の情報」とすることになると思います。
React ドキュメントの場合 JSX や state は不可算名詞扱いなので、「ひと固まりの JSX」「複数の state ではなく 1 個の state」などと言いたい文脈で "piece of" がよく出てきます。日本語の場合、無理やり "JSX 素片" などとすることもできるとは思いますが、単に無視するのが最も楽かな、ということでした。
Uh oh!
There was an error while loading. Please reload this page.