Skip to content

Commit c3d96bb

Browse files
authored
Merge pull request #282 from reactjs/tr/concurrent-reference
Translate Concurrent Mode Reference
2 parents c3cadaf + fce935d commit c3d96bb

File tree

1 file changed

+49
-49
lines changed

1 file changed

+49
-49
lines changed

content/docs/concurrent-mode-reference.md

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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
---
@@ -14,52 +14,52 @@ prev: concurrent-mode-adoption.html
1414

1515
<div class="scary">
1616

17-
>Caution:
17+
>警告:
1818
>
19-
>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.
19+
> このページでは**安定リリースで[まだ利用できない](/docs/concurrent-mode-adoption.html)実験的機能**を説明しています。本番のアプリケーションで React の実験的ビルドを利用しないでください。これらの機能は React の一部となる前に警告なく大幅に変更される可能性があります。
2020
>
21-
>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.
21+
> このドキュメントは興味のある読者やアーリーアダプター向けのものです。**React が初めての方はこれらの機能を気にしないで構いません** -- 今すぐに学ぶ必要はありません。
2222
2323
</div>
2424

25-
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).
25+
このページは React [並列モード](/docs/concurrent-mode-intro.html) についての API リファレンスです。ガイド付きの案内記事を探している場合は、[Concurrent UI Patterns](/docs/concurrent-mode-patterns.html) を参照してください。
2626

27-
**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!**
27+
**補足:これは公開プレビューであり最終安定板ではありません。これらの API は将来高確率で変更されます。自己責任で使ってください!**
2828

29-
- [Enabling Concurrent Mode](#concurrent-mode)
29+
- [並列モードの有効化](#concurrent-mode)
3030
- [`createRoot`](#createroot)
3131
- [`createBlockingRoot`](#createblockingroot)
32-
- [Suspense](#suspense)
32+
- [サスペンス API](#suspense)
3333
- [`Suspense`](#suspensecomponent)
3434
- [`SuspenseList`](#suspenselist)
3535
- [`useTransition`](#usetransition)
3636
- [`useDeferredValue`](#usedeferredvalue)
3737

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

4040
### `createRoot` {#createroot}
4141

4242
```js
4343
ReactDOM.createRoot(rootNode).render(<App />);
4444
```
4545

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

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

5050
### `createBlockingRoot` {#createblockingroot}
5151

5252
```js
5353
ReactDOM.createBlockingRoot(rootNode).render(<App />)
5454
```
5555

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

58-
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.
58+
並列モードにオプトインすることで React の動作方法について意味上の変更が加わります。これは少数のコンポーネントだけで並列モードを使うということが不可能であるということを意味します。このため、いくつかのアプリケーションでは並列モードに直接移行することができないかもしれません。
5959

60-
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.
60+
ブロッキングモードには並列モードの機能の小さなサブセットのみが含まれているので、直接的な移行ができないアプリケーションのための中間的な移行ステップとなることを意図しています。
6161

62-
## Suspense API {#suspense}
62+
## サスペンス API {#suspense}
6363

6464
### `Suspense` {#suspensecomponent}
6565

@@ -70,13 +70,13 @@ Blocking Mode only contains a small subset of Concurrent Mode features and is in
7070
</Suspense>
7171
```
7272

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

75-
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.
75+
上記の例では、`ProfileDetails` は何らかのデータを取得するために非同期 API コールを待機しています。`ProfileDetails` `ProfilePhoto` を待機している間、`Loading...` というフォールバックを代わりに表示します。`<Suspense>` 内のすべての子要素がロードされるまでは、フォールバックが表示されつづけることに注意することが重要です。
7676

77-
`Suspense` takes two props:
78-
* **fallback** takes a loading indicator. The fallback is shown until all of the children of the `Suspense` component have finished rendering.
79-
* **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.
77+
`Suspense` は 2 つの props を受け取ります:
78+
* **fallback** はローディングインジケータを受け取ります。フォールバックは `Suspense` コンポーネントのすべての子要素がレンダーを完了するまで表示されます。
79+
* **unstable_avoidThisFallback** は真偽値を受け取ります。初回ロード時にこのバウンダリの開放を「スキップ」するかどうかを React に伝えます。この API は将来のリリースで高確率で削除されます。
8080

8181
### `<SuspenseList>` {#suspenselist}
8282

@@ -95,19 +95,19 @@ In this example, `ProfileDetails` is waiting for an asynchronous API call to fet
9595
</SuspenseList>
9696
```
9797

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

100-
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).
100+
複数のコンポーネントがデータを取得する必要がある場合、それらのデータは予測不能な順番で到着するかもしれません。しかし、`SuspenseList` でこれらの要素をラップすることで、React は手前にある要素が全て表示されるまで、ある要素を表示しないようになります(この挙動は変更可能です)。
101101

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

110-
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.
110+
`SuspenseList` はすぐ直下にある `Suspense` `SuspenseList` にのみ作用することに気をつけてください。1 階層分より深くまでバウンダリを探しに行くことはしません。しかし、複数の `SuspenseList` を互いにネストさせてグリッドを作ることは可能です。
111111

112112
### `useTransition` {#usetransition}
113113

@@ -117,13 +117,13 @@ const SUSPENSE_CONFIG = { timeoutMs: 2000 };
117117
const [startTransition, isPending] = useTransition(SUSPENSE_CONFIG);
118118
```
119119

120-
`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.
120+
`useTransition` を使うことで、**次の画面に遷移する**前にコンテンツがロードされるのを待機し、コンポーネントが望ましくないロード中状態を表示することを避けられるようになります。また、データ取得に関わる遅い更新を後続するレンダーへと遅延させることで、より重要な更新が即座にレンダーされるようにすることができます。
121121

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

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

128128
```js
129129
const SUSPENSE_CONFIG = {timeoutMs: 2000 };
@@ -153,21 +153,21 @@ function App() {
153153
}
154154
```
155155

156-
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`).
156+
このコードでは、`startTransition` を使ってデータの取得をラップしています。これにより即座にプロフィールの取得を開始できる一方で、次のプロフィールページとそれに結びついている `Spinner` の表示を 2 秒間(`timeoutMs` に示されている時間)遅延させます。
157157

158-
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.
158+
真偽値である `isPending` によってコンポーネントのトランジションが進行中かどうかを知ることができ、ユーザに前のプロフィールページ内で何らかのロード中テキストを表示してトランジションの進行中状態を伝えることができます。
159159

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

162-
#### useTransition Config {#usetransition-config}
162+
#### useTransition 設定 {#usetransition-config}
163163

164164
```js
165165
const SUSPENSE_CONFIG = { timeoutMs: 2000 };
166166
```
167167

168-
`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).
168+
`useTransition` はオプションで `timeoutMs` 値の入った **Suspense Config** を受け取ります。このタイムアウト(ミリ秒で指定)は、React に次の state(上記の例では新しいプロフィールページ)を表示するまでにどれだけ待つかを伝えます。
169169

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

172172

173173
### `useDeferredValue` {#usedeferredvalue}
@@ -176,11 +176,11 @@ const SUSPENSE_CONFIG = { timeoutMs: 2000 };
176176
const deferredValue = useDeferredValue(value, { timeoutMs: 2000 });
177177
```
178178

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

181-
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.
181+
ユーザ入力に基づいて即座にレンダーされる何かや、データ取得を待つ必要がある何かがある場合に、インターフェスをレスポンシブに保つためによく使われます。
182182

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

185185
```js
186186
function App() {
@@ -199,16 +199,16 @@ function App() {
199199
}
200200
```
201201

202-
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.
202+
これにより `input` が即座に新しいテキストを表示し始めることができ、ウェブページがレスポンシブに保たれます。その一方で `MySlowList` は、`timeoutMs` に書かれているとおり更新まで最大 2 秒間遅延されるので、バックグラウンドで現在のテキストの値がレンダーできるようになります。
203203

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

206-
#### useDeferredValue Config {#usedeferredvalue-config}
206+
#### useDeferredValue 設定 {#usedeferredvalue-config}
207207

208208
```js
209209
const SUSPENSE_CONFIG = { timeoutMs: 2000 };
210210
```
211211

212-
`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.
212+
`useTransition` はオプションで `timeoutMs` 値の入った **Suspense Config** を受け取ります。このタイムアウト(ミリ秒で指定)は、React に遅延される値がどれだけ遅れても構わないのかを伝えます。
213213

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

0 commit comments

Comments
 (0)