diff --git a/src/content/reference/react/useImperativeHandle.md b/src/content/reference/react/useImperativeHandle.md
index 2ec0bcb8b9..51209226a1 100644
--- a/src/content/reference/react/useImperativeHandle.md
+++ b/src/content/reference/react/useImperativeHandle.md
@@ -46,7 +46,7 @@ function MyInput({ ref }) {
-Starting with React 19, [`ref` is available as a prop.](/blog/2024/12/05/react-19#ref-as-a-prop) In React 18 and earlier, it was necessary to get the `ref` from [`forwardRef`.](/reference/react/forwardRef)
+从 React 19 开始, [`ref` 可作为 prop 使用](/blog/2024/12/05/react-19#ref-as-a-prop) 。在 React 18 及更早版本中,需要通过 `forwardRef` 来获取 [`ref`](/reference/react/forwardRef) 。
diff --git a/src/content/reference/react/useTransition.md b/src/content/reference/react/useTransition.md
index 133facdfd4..b0340f8a56 100644
--- a/src/content/reference/react/useTransition.md
+++ b/src/content/reference/react/useTransition.md
@@ -65,9 +65,9 @@ function TabContainer() {
```
-#### Functions called in `startTransition` are called "Actions". {/*functions-called-in-starttransition-are-called-actions*/}
+#### 传递给 `startTransition` 的函数被称为 "Actions" {/*functions-called-in-starttransition-are-called-actions*/}
-The function passed to `startTransition` is called an "Action". By convention, any callback called inside `startTransition` (such as a callback prop) should be named `action` or include the "Action" suffix:
+传递给 `startTransition` 的函数被称为 "Action" 。按照约定,任何在 `startTransition` 内调用的回调函数(例如作为回调的 prop)应命名为 `action` 或包含 "Action" 后缀:
```js {1,9}
function SubmitButton({ submitAction }) {
@@ -95,7 +95,7 @@ function SubmitButton({ submitAction }) {
#### 参数 {/*starttransition-parameters*/}
-* `action`: A function that updates some state by calling one or more [`set` functions](/reference/react/useState#setstate). React calls `action` immediately with no parameters and marks all state updates scheduled synchronously during the `action` function call as Transitions. Any async calls that are awaited in the `action` will be included in the Transition, but currently require wrapping any `set` functions after the `await` in an additional `startTransition` (see [Troubleshooting](#react-doesnt-treat-my-state-update-after-await-as-a-transition)). State updates marked as Transitions will be [non-blocking](#marking-a-state-update-as-a-non-blocking-transition) and [will not display unwanted loading indicators](#preventing-unwanted-loading-indicators).
+* `action`:通过调用一个或多个 [`set` 函数](/reference/react/useState#setstate) 来更新某些状态的函数。React 会立即调用 `action`(无需参数),并将 `action` 函数调用期间同步调度的所有状态更新标记为 Transition。在 `action` 中通过 `await` 等待的异步调用会被包含在 Transition 中,但目前需要在 `await` 之后将任何 `set` 函数再次包裹在 `startTransition` 中(参见[疑难解答](#react-doesnt-treat-my-state-update-after-await-as-a-transition))。标记为 Transition 的状态更新将具备[非阻塞特性](#marking-a-state-update-as-a-non-blocking-transition),并且[不会显示不必要的加载指示](#preventing-unwanted-loading-indicators)。
#### 返回值 {/*starttransition-returns*/}
@@ -109,7 +109,7 @@ function SubmitButton({ submitAction }) {
* 传递给 `startTransition` 的函数会被立即执行,并将在其执行期间发生的所有状态更新标记为 transition。如果你尝试在 `setTimeout` 中执行状态更新,它们将不会被标记为 transition。
-* You must wrap any state updates after any async requests in another `startTransition` to mark them as Transitions. This is a known limitation that we will fix in the future (see [Troubleshooting](#react-doesnt-treat-my-state-update-after-await-as-a-transition)).
+* 你必须将任意异步请求之后的状态更新用 `startTransition` 包裹,以将其标记为 Transition 更新。这是一个已知限制,我们将在未来版本中修复(参见[疑难解答](#react-doesnt-treat-my-state-update-after-await-as-a-transition))。
* `startTransition` 函数具有稳定的标识,所以你经常会看到 Effect 的依赖数组中会省略它,即使包含它也不会导致 Effect 重新触发。如果 linter 允许你省略依赖项并且没有报错,那么你就可以安全地省略它。[了解移除 Effect 依赖项的更多信息。](/learn/removing-effect-dependencies#move-dynamic-objects-and-functions-inside-your-effect)
@@ -161,17 +161,17 @@ function CheckoutForm() {
}
```
-The function passed to `startTransition` is called the "Action". You can update state and (optionally) perform side effects within an Action, and the work will be done in the background without blocking user interactions on the page. A Transition can include multiple Actions, and while a Transition is in progress, your UI stays responsive. For example, if the user clicks a tab but then changes their mind and clicks another tab, the second click will be immediately handled without waiting for the first update to finish.
+传递给 `startTransition` 的函数被称为 "Action"。你可以在 Action 中更新状态和执行副作用操作,这些工作将在后台执行,不会阻塞页面的用户交互。一个 Transition 可以包含多个 Action,且在 Transition 进行期间,你的用户界面将保持流畅响应。例如,如果用户点击一个标签页后又改变主意点击另一个标签页,第二个点击会立即被处理,无需等待第一个更新完成。
-To give the user feedback about in-progress Transitions, to `isPending` state switches to `true` at the first call to `startTransition`, and stays `true` until all Actions complete and the final state is shown to the user. Transitions ensure side effects in Actions to complete in order to [prevent unwanted loading indicators](#preventing-unwanted-loading-indicators), and you can provide immediate feedback while the Transition is in progress with `useOptimistic`.
+为了向用户提供 Transition 进行中的反馈, `isPending` 状态会在首次调用 `startTransition` 时切换为 `true`,并会在所有 Action 完成且最终状态呈现给用户前一直保持为 `true`。Transition 机制确保 Action 中的副作用会完整执行以[避免不必要的加载指示](#preventing-unwanted-loading-indicators),同时你可以通过 `useOptimistic` 在 Transition 进行期间提供即时反馈。
-
+
-#### Updating the quantity in an Action {/*updating-the-quantity-in-an-action*/}
+#### 在 Action 中更新数量 {/*updating-the-quantity-in-an-action*/}
-In this example, the `updateQuantity` function simulates a request to the server to update the item's quantity in the cart. This function is *artificially slowed down* so that it takes at least a second to complete the request.
+在这个示例中,`updateQuantity` 函数模拟向服务端发送请求来更新购物车中的商品数量。该函数*被人为地减慢*,使得完成请求至少需要一秒钟。
-Update the quantity multiple times quickly. Notice that the pending "Total" state is shown while any requests are in progress, and the "Total" updates only after the final request is complete. Because the update is in an Action, the "quantity" can continue to be updated while the request is in progress.
+快速多次更新数量。请注意,当任何请求在进行中时,都会显示挂起的 “Total” 状态,并且 “Total” 只会在最后一个请求完成后更新。由于更新操作在 Action 中进行,在请求处理期间仍可继续更新“quantity"”。
@@ -305,22 +305,22 @@ export async function updateQuantity(newQuantity) {
-This is a basic example to demonstrate how Actions work, but this example does not handle requests completing out of order. When updating the quantity multiple times, it's possible for the previous requests to finish after later requests causing the quantity to update out of order. This is a known limitation that we will fix in the future (see [Troubleshooting](#my-state-updates-in-transitions-are-out-of-order) below).
+这是一个演示 Action 工作原理的基础示例,但此示例未处理请求完成顺序错乱的问题。当多次更新数量时,较早的请求可能会在较晚的请求之后完成,导致数量更新顺序混乱。这是一个已知限制,我们将在未来版本中修复(参见下方的[疑难解答](#my-state-updates-in-transitions-are-out-of-order))。
-For common use cases, React provides built-in abstractions such as:
-- [`useActionState`](/reference/react/useActionState)
-- [`