File tree Expand file tree Collapse file tree 1 file changed +1
-1
lines changed
src/content/reference/react Expand file tree Collapse file tree 1 file changed +1
-1
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ function CheckoutForm() {
163
163
164
164
传递给 ` startTransition ` 的函数被称为 "Action"。您可以在 Action 中更新状态和执行副作用操作,这些工作将在后台执行,不会阻塞页面的用户交互。一个 Transition 可以包含多个 Action,且在 Transition 进行期间,你的用户界面将保持流畅响应。例如,如果用户点击一个标签页后又改变主意点击另一个标签页,第二个点击会立即被处理,无需等待第一个更新完成。
165
165
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 进行期间提供即时反馈。
167
167
168
168
<Recipes titleText =" Actions 与常规事件处理的区别 " >
169
169
You can’t perform that action at this time.
0 commit comments