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
Copy file name to clipboardExpand all lines: content/docs/concurrent-mode-reference.md
+49-49
Original file line number
Diff line number
Diff line change
@@ -1,54 +1,54 @@
1
1
---
2
2
id: concurrent-mode-reference
3
-
title: Concurrent Mode API Reference (Experimental)
3
+
title: 並列モード API リファレンス(実験的機能)
4
4
permalink: docs/concurrent-mode-reference.html
5
5
prev: concurrent-mode-adoption.html
6
6
---
7
7
8
-
>Caution:
8
+
>警告:
9
9
>
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.
>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.
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) を参照してください。
15
15
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 は将来高確率で変更されます。自己責任で使ってください!**
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.
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.
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>`内のすべての子要素がロードされるまでは、フォールバックが表示されつづけることに注意することが重要です。
65
65
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.
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).
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`を互いにネストさせてグリッドを作ることは可能です。
`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.
**If some state update causes a component to suspend, that state update should be wrapped in a transition.**
115
+
**何らかの state の更新がコンポーネントのサスペンドを引き起こす場合は、その更新はトランジションでラップされるべきです。**
116
116
117
117
```js
118
118
constSUSPENSE_CONFIG= {timeoutMs:2000 };
@@ -142,21 +142,21 @@ function App() {
142
142
}
143
143
```
144
144
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`).
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.
`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).
Returns a deferred version of the value that may "lag behind" it for at most `timeoutMs`.
168
+
最大で `timeoutMs` まで「遅れる」ことのできる、遅延されたバージョンの値を返します。
169
169
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.
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.
`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.
0 commit comments