Skip to content

Commit 43a15a0

Browse files
HiWangyeahloveloki
andauthored
Update src/content/reference/react/useTransition.md
Co-authored-by: Xleine <xleine@qq.com>
1 parent c5a3aac commit 43a15a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/content/reference/react/useTransition.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ function CheckoutForm() {
163163

164164
传递给 `startTransition` 的函数被称为 "Action"。您可以在 Action 中更新状态和执行副作用操作,这些工作将在后台执行,不会阻塞页面的用户交互。一个 Transition 可以包含多个 Action,且在 Transition 进行期间,你的用户界面将保持流畅响应。例如,如果用户点击一个标签页后又改变主意点击另一个标签页,第二个点击会立即被处理,无需等待第一个更新完成。
165165

166-
为了向用户提供 Transition 进行中的反馈, `isPending` 状态会在首次调用 `startTransition` 时切换为 `true`并且保持 `true` 直到所有 Actions 完成且最终状态呈现给用户。Transition 机制确保 Action 中的副作用会完整执行以[避免不必要的加载指示](#preventing-unwanted-loading-indicators),同时你可以通过 `useOptimistic` 在 Transition 进行期间提供即时反馈。
166+
为了向用户提供 Transition 进行中的反馈, `isPending` 状态会在首次调用 `startTransition` 时切换为 `true`并会在所有 Action 完成且最终状态呈现给用户前一直保持为 `true`。Transition 机制确保 Action 中的副作用会完整执行以[避免不必要的加载指示](#preventing-unwanted-loading-indicators),同时你可以通过 `useOptimistic` 在 Transition 进行期间提供即时反馈。
167167

168168
<Recipes titleText="Actions 与常规事件处理的区别">
169169

0 commit comments

Comments
 (0)