Skip to content

Commit a889e40

Browse files
committed
Translate Concurrent Mode Reference
1 parent 2cacc5b commit a889e40

File tree

1 file changed

+49
-49
lines changed

1 file changed

+49
-49
lines changed

content/docs/concurrent-mode-reference.md

+49-49
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
11
---
22
id: concurrent-mode-reference
3-
title: Concurrent Mode API Reference (Experimental)
3+
title: 並列モード API リファレンス(実験的機能)
44
permalink: docs/concurrent-mode-reference.html
55
prev: concurrent-mode-adoption.html
66
---
77

8-
>Caution:
8+
>警告:
99
>
10-
>This page describes **experimental features that are [not yet available](/docs/concurrent-mode-adoption.html) in a stable release**. Don't rely on experimental builds of React in production apps. These features may change significantly and without a warning before they become a part of React.
10+
> このページでは**安定リリースで[まだ利用できない](/docs/concurrent-mode-adoption.html)実験的機能**を説明しています。本番のアプリケーションで React の実験的ビルドを利用しないでください。これらの機能は React の一部となる前に警告なく大幅に変更される可能性があります。
1111
>
12-
>This documentation is aimed at early adopters and people who are curious. If you're new to React, don't worry about these features -- you don't need to learn them right now.
12+
> このドキュメントは興味のある読者やアーリーアダプター向けのものです。React が初めての方はこれらの機能を気にしないで構いません -- 今すぐに学ぶ必要はありません。
1313
14-
This page is an API reference for the React [Concurrent Mode](/docs/concurrent-mode-intro.html). If you're looking for a guided introduction instead, check out [Concurrent UI Patterns](/docs/concurrent-mode-patterns.html).
14+
このページは React [並列モード](/docs/concurrent-mode-intro.html) についての API リファレンスです。ガイド付きの案内記事を探している場合は、[Concurrent UI Patterns](/docs/concurrent-mode-patterns.html) を参照してください。
1515

16-
**Note: This is a Community Preview and not the final stable version. There will likely be future changes to these APIs. Use at your own risk!**
16+
**補足:これは公開プレビューであり最終安定板ではありません。これらの API は将来高確率で変更されます。自己責任で使ってください!**
1717

18-
- [Enabling Concurrent Mode](#concurrent-mode)
18+
- [並列モードの有効化](#concurrent-mode)
1919
- [`createRoot`](#createroot)
2020
- [`createBlockingRoot`](#createblockingroot)
21-
- [Suspense](#suspense)
21+
- [サスペンス API](#suspense)
2222
- [`Suspense`](#suspensecomponent)
2323
- [`SuspenseList`](#suspenselist)
2424
- [`useTransition`](#usetransition)
2525
- [`useDeferredValue`](#usedeferredvalue)
2626

27-
## Enabling Concurrent Mode {#concurrent-mode}
27+
## 並列モードの有効化 {#concurrent-mode}
2828

2929
### `createRoot` {#createroot}
3030

3131
```js
3232
ReactDOM.createRoot(rootNode).render(<App />);
3333
```
3434

35-
Replaces `ReactDOM.render(<App />, rootNode)` and enables Concurrent Mode.
35+
`ReactDOM.render(<App />, rootNode)` を置き換えて、並列モードを有効化します。
3636

37-
For more information on Concurrent Mode, check out the [Concurrent Mode documentation.](/docs/concurrent-mode-intro.html)
37+
並列モードについての詳細は[並列モードのドキュメント](/docs/concurrent-mode-intro.html)を参照してください。
3838

3939
### `createBlockingRoot` {#createblockingroot}
4040

4141
```js
4242
ReactDOM.createBlockingRoot(rootNode).render(<App />)
4343
```
4444

45-
Replaces `ReactDOM.render(<App />, rootNode)` and enables [Blocking Mode](/docs/concurrent-mode-adoption.html#migration-step-blocking-mode).
45+
`ReactDOM.render(<App />, rootNode)` を置き換えて[ブロッキングモード](/docs/concurrent-mode-adoption.html#migration-step-blocking-mode)を有効化します。
4646

47-
Opting into Concurrent Mode introduces semantic changes to how React works. This means that you can't use Concurrent Mode in just a few components. Because of this, some apps may not be able to migrate directly to Concurrent Mode.
47+
並列モードにオプトインすることで React の動作方法について意味上の変更が加わります。これは少数のコンポーネントだけで並列モードを使うということが不可能であるということを意味します。このため、いくつかのアプリケーションでは並列モードに直接移行することができないかもしれません。
4848

49-
Blocking Mode only contains a small subset of Concurrent Mode features and is intended as an intermediary migration step for apps that are unable to migrate directly.
49+
ブロッキングモードには並列モードの機能の小さなサブセットのみが含まれているので、直接的な移行ができないアプリケーションのための中間的な移行ステップとなることを意図しています。
5050

51-
## Suspense API {#suspense}
51+
## サスペンス API {#suspense}
5252

5353
### `Suspense` {#suspensecomponent}
5454

@@ -59,13 +59,13 @@ Blocking Mode only contains a small subset of Concurrent Mode features and is in
5959
</Suspense>
6060
```
6161

62-
`Suspense` lets your components "wait" for something before they can render, showing a fallback while waiting.
62+
`Suspense` により、レンダー可能になる前にコンポーネントが「待機」し、待機中にフォールバックを表示できるようになります。
6363

64-
In this example, `ProfileDetails` is waiting for an asynchronous API call to fetch some data. While we wait for `ProfileDetails` and `ProfilePhoto`, we will show the `Loading...` fallback instead. It is important to note that until all children inside `<Suspense>` has loaded, we will continue to show the fallback.
64+
以下の例では、`ProfileDetails` は何らかのデータを取得するために非同期 API コールを待機しています。`ProfileDetails` `ProfilePhoto` を待機している間、`Loading...` というフォールバックを代わりに表示します。`<Suspense>` 内のすべての子要素がロードされるまでは、フォールバックが表示されつづけることに注意することが重要です。
6565

66-
`Suspense` takes two props:
67-
* **fallback** takes a loading indicator. The fallback is shown until all of the children of the `Suspense` component have finished rendering.
68-
* **unstable_avoidThisFallback** takes a boolean. It tells React whether to "skip" revealing this boundary during the initial load. This API will likely be removed in a future release.
66+
`Suspense` は 2 つの props を受け取ります:
67+
* **fallback** はローディングインジケータを受け取ります。フォールバックは `Suspense` コンポーネントのすべての子要素がレンダーを完了するまで表示されます。
68+
* **unstable_avoidThisFallback** は真偽値を受け取ります。初回ロード時にこのバウンダリの開放を「スキップ」するかどうかを React に伝えます。この API は将来のリリースで高確率で削除されます。
6969

7070
### `<SuspenseList>` {#suspenselist}
7171

@@ -84,19 +84,19 @@ In this example, `ProfileDetails` is waiting for an asynchronous API call to fet
8484
</SuspenseList>
8585
```
8686

87-
`SuspenseList` helps coordinate many components that can suspend by orchestrating the order in which these components are revealed to the user.
87+
`SuspenseList` はサスペンドしうる多数のコンポーネントがユーザに開放される順番を制御することで、それらのコンポーネントが協調してうまく動くようにします。
8888

89-
When multiple components need to fetch data, this data may arrive in an unpredictable order. However, if you wrap these items in a `SuspenseList`, React will not show an item in the list until previous items have been displayed (this behavior is adjustable).
89+
複数のコンポーネントがデータを取得する必要がある場合、それらのデータは予測不能な順番で到着するかもしれません。しかし、`SuspenseList` でこれらの要素をラップすることで、React は手前にある要素が全て表示されるまで、ある要素を表示しないようになります(この挙動は変更可能です)。
9090

91-
`SuspenseList` takes two props:
92-
* **revealOrder (forwards, backwards, together)** defines the order in which the `SuspenseList` children should be revealed.
93-
* `together` reveals *all* of them when they're ready instead of one by one.
94-
* **tail (collapsed, hidden)** dictates how unloaded items in a `SuspenseList` is shown.
95-
* By default, `SuspenseList` will show all fallbacks in the list.
96-
* `collapsed` shows only the next fallback in the list.
97-
* `hidden` doesn't show any unloaded items.
91+
`SuspenseList` は 2 つの prosp を受け取ります:
92+
* **revealOrder (forwards, backwards, together)** `SuspenseList` の子要素が表示される順番を定義します。
93+
* `together` は 1 つずつではなく、*すべての*子要素を準備完了した時点でまとめて表示します。
94+
* **tail (collapsed, hidden)** `SuspenseList` 内のロードされていない要素がどのように表示されるかを記述します。
95+
* デフォルトでは `SuspenseList` はリスト中のすべてのフォールバックを表示します。
96+
* `collapsed` はリスト内の次のフォールバックのみを表示します。
97+
* `hidden` は未ロードの要素を一切表示しません。
9898

99-
Note that `SuspenseList` only operates on the closest `Suspense` and `SuspenseList` components below it. It does not search for boundaries deeper than one level. However, it is possible to nest multiple `SuspenseList` components in each other to build grids.
99+
`SuspenseList` はすぐ直下にある `Suspense` and `SuspenseList` にのみ作用することに気をつけてください。1 階層より深くまでバウンダリを探しに行くことはしません。しかし、複数の `SuspenseList` を互いにネストさせてグリッドを作ることは可能です。
100100

101101
### `useTransition` {#usetransition}
102102

@@ -106,13 +106,13 @@ const SUSPENSE_CONFIG = { timeoutMs: 2000 };
106106
const [startTransition, isPending] = useTransition(SUSPENSE_CONFIG);
107107
```
108108

109-
`useTransition` allows components to avoid undesirable loading states by waiting for content to load before **transitioning to the next screen**. It also allows components to defer slower, data fetching updates until subsequent renders so that more crucial updates can be rendered immediately.
109+
`useTransition` を使うことで、**次の画面に遷移する**前にコンテンツがロードされるのを待機し、コンポーネントが望ましくないロード中状態を表示することを避けられるようになります。また、データ取得に関わる遅い更新を後続するレンダーへと遅延させることで、より重要な更新が即座にレンダーされるようにすることができます。
110110

111-
The `useTransition` hook returns two values in an array.
112-
* `startTransition` is a function that takes a callback. We can use it to tell React which state we want to defer.
113-
* `isPending` is a boolean. It's React's way of informing us whether we're waiting for the transition to finish.
111+
`useTransition` フックは 2 つの値を配列に入れて返します。
112+
* `startTransition` はコールバックを受け取る関数です。これを使って、React にどの state を遅延させたいのかを伝えることができます。
113+
* `isPending` は真偽値です。これがトランジションの完了を待っているかどうかを React が伝えてくれる手段です。
114114

115-
**If some state update causes a component to suspend, that state update should be wrapped in a transition.**
115+
**何らかの state の更新がコンポーネントのサスペンドを引き起こす場合は、その更新はトランジションでラップされるべきです。**
116116

117117
```js
118118
const SUSPENSE_CONFIG = {timeoutMs: 2000 };
@@ -142,21 +142,21 @@ function App() {
142142
}
143143
```
144144

145-
In this code, we've wrapped our data fetching with `startTransition`. This allows us to start fetching the profile data right away, while deferring the render of the next profile page and its associated `Spinner` for 2 seconds (the time shown in `timeoutMs`).
145+
このコードでは、`startTransition` を使ってデータの取得をラップしています。これにより即座にプロフィールの取得を開始できる一方で、次のプロフィールページとそれに結びついている `Spinner` の表示を 2 秒間(`timeoutMs` に示されている時間)遅延させます。
146146

147-
The `isPending` boolean lets React know that our component is transitioning, so we are able to let the user know this by showing some loading text on the previous profile page.
147+
真偽値である `isPending` によってコンポーネントのトランジションが進行中かどうかを知ることができ、ユーザに前のプロフィールページ内で何らかのロード中テキストを表示してトランジションの進行中状態を伝えることができます。
148148

149-
**For an in-depth look at transitions, you can read [Concurrent UI Patterns](/docs/concurrent-mode-patterns.html#transitions).**
149+
**トランジションについての詳細な解説は [Concurrent UI Patterns](/docs/concurrent-mode-patterns.html#transitions) で読めます。**
150150

151-
#### useTransition Config {#usetransition-config}
151+
#### useTransition 設定 {#usetransition-config}
152152

153153
```js
154154
const SUSPENSE_CONFIG = { timeoutMs: 2000 };
155155
```
156156

157-
`useTransition` accepts an **optional Suspense Config** with a `timeoutMs`. This timeout (in milliseconds) tells React how long to wait before showing the next state (the new Profile Page in the above example).
157+
`useTransition` はオプションで `timeoutMs` 値の入った **Suspense Config** を受け取ります。このタイムアウト(ミリ秒で指定)は、React に次の state(上記の例では新しいプロフィールページ)を表示するまでにどれだけ待つかを伝えます。
158158

159-
**Note: We recommend that you share Suspense Config between different modules.**
159+
**補足:Suspense Config は複数のモジュール間で共有することをお勧めします。**
160160

161161

162162
### `useDeferredValue` {#usedeferredvalue}
@@ -165,11 +165,11 @@ const SUSPENSE_CONFIG = { timeoutMs: 2000 };
165165
const deferredValue = useDeferredValue(value, { timeoutMs: 2000 });
166166
```
167167

168-
Returns a deferred version of the value that may "lag behind" it for at most `timeoutMs`.
168+
最大で `timeoutMs` まで「遅れる」ことのできる、遅延されたバージョンの値を返します。
169169

170-
This is commonly used to keep the interface responsive when you have something that renders immediately based on user input and something that needs to wait for a data fetch.
170+
ユーザ入力に基づいて即座にレンダーされる何かや、データ取得を待つ必要がある何かがある場合に、インターフェスをレスポンシブに保つためによく使われます。
171171

172-
A good example of this is a text input.
172+
よい例はテキスト入力です。
173173

174174
```js
175175
function App() {
@@ -188,16 +188,16 @@ function App() {
188188
}
189189
```
190190

191-
This allows us to start showing the new text for the `input` immediately, which allows the webpage to feel responsive. Meanwhile, `MySlowList` "lag behind" for up to 2 seconds according to the `timeoutMs` before updating, allowing it to render with the current text in the background.
191+
これにより `input` が即座に新しいテキストを表示し始めることができ、ウェブページがレスポンシブに保たれます。その一方で `MySlowList` は、`timeoutMs` に書かれているとおり更新まで最大 2 秒間遅延されるので、バックグラウンドで現在のテキストの値がレンダーできるようになります。
192192

193-
**For an in-depth look at deferring values, you can read [Concurrent UI Patterns](/docs/concurrent-mode-patterns.html#deferring-a-value).**
193+
**値の遅延についての詳細な解説は [Concurrent UI Patterns](/docs/concurrent-mode-patterns.html#deferring-a-value) で読めます。**
194194

195-
#### useDeferredValue Config {#usedeferredvalue-config}
195+
#### useDeferredValue 設定 {#usedeferredvalue-config}
196196

197197
```js
198198
const SUSPENSE_CONFIG = { timeoutMs: 2000 };
199199
```
200200

201-
`useDeferredValue` accepts an **optional Suspense Config** with a `timeoutMs`. This timeout (in milliseconds) tells React how long the deferred value is allowed to lag behind.
201+
`useTransition` はオプションで `timeoutMs` 値の入った **Suspense Config** を受け取ります。このタイムアウト(ミリ秒で指定)は、React に遅延される値がどれだけ遅れても構わないのかを伝えます。
202202

203-
React will always try to use a shorter lag when network and device allows it.
203+
ネットワークやデバイス性能が許す範囲で、React は常にラグを短くしようとします。

0 commit comments

Comments
 (0)