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
*`scope`: A function that updates some state by calling one or more [`set`functions.](/reference/react/useState#setstate)React immediately calls `scope`with no parameters and marks all state updates scheduled synchronously during the `scope`function call as transitions. They will be [non-blocking](/reference/react/useTransition#marking-a-state-update-as-a-non-blocking-transition) and [will not display unwanted loading indicators.](/reference/react/useTransition#preventing-unwanted-loading-indicators)
44
+
*`scope`: 1 つ以上の [`set`関数](/reference/react/useState#setstate)を呼び出して state を更新する関数。React は引数なしで直ちに `scope`を呼び出し、`scope`関数呼び出し中に同期的にスケジュールされたすべての state 更新をトランジションとしてマークします。このような更新は[ノンブロッキング](/reference/react/useTransition#marking-a-state-update-as-a-non-blocking-transition)になり、[不要なローディングインジケータを表示しない](/reference/react/useTransition#preventing-unwanted-loading-indicators)ようになります。
45
45
46
-
#### Returns {/*returns*/}
46
+
#### 返り値 {/*returns*/}
47
47
48
-
`startTransition`does not return anything.
48
+
`startTransition`は何も返しません。
49
49
50
-
#### Caveats {/*caveats*/}
50
+
#### 注意点 {/*caveats*/}
51
51
52
-
*`startTransition`does not provide a way to track whether a transition is pending. To show a pending indicator while the transition is ongoing, you need [`useTransition`](/reference/react/useTransition)instead.
*You can wrap an update into a transition only if you have access to the `set`function of that state. If you want to start a transition in response to some prop or a custom Hook return value, try [`useDeferredValue`](/reference/react/useDeferredValue)instead.
*The function you pass to `startTransition`must be synchronous. React immediately executes this function, marking all state updates that happen while it executes as transitions. If you try to perform more state updates later (for example, in a timeout), they won't be marked as transitions.
56
+
*`startTransition`に渡す関数は同期的でなければなりません。React はこの関数を直ちに実行し、その実行中に行われるすべての state 更新をトランジションとしてマークします。後になって(例えばタイムアウト内で)さらに state 更新をしようとすると、それらはトランジションとしてマークされません。
57
57
58
-
*A state update marked as a transition will be interrupted by other state updates. For example, if you update a chart component inside a transition, but then start typing into an input while the chart is in the middle of a re-render, React will restart the rendering work on the chart component after handling the input state update.
58
+
*トランジションとしてマークされた state 更新は、他の state 更新によって中断されます。例えば、トランジション内でチャートコンポーネントを更新した後、チャートの再レンダーの途中で入力フィールドに入力を始めた場合、React は入力欄の更新の処理後にチャートコンポーネントのレンダー作業を再開します。
59
59
60
-
*Transition updates can't be used to control text inputs.
60
+
*トランジションによる更新はテキスト入力欄の制御には使用できません。
61
61
62
-
*If there are multiple ongoing transitions, React currently batches them together. This is a limitation that will likely be removed in a future release.
With a transition, your UI stays responsive in the middle of a re-render. For example, if the user clicks a tab but then change their mind and click another tab, they can do that without waiting for the first re-render to finish.
`startTransition`is very similar to [`useTransition`](/reference/react/useTransition), except that it does not provide the `isPending`flag to track whether a transition is ongoing. You can call `startTransition` when `useTransition` is not available. For example, `startTransition`works outside components, such as from a data library.
0 commit comments