diff --git a/src/content/learn/queueing-a-series-of-state-updates.md b/src/content/learn/queueing-a-series-of-state-updates.md
index 41de6529a..2e2ddeb1f 100644
--- a/src/content/learn/queueing-a-series-of-state-updates.md
+++ b/src/content/learn/queueing-a-series-of-state-updates.md
@@ -1,23 +1,23 @@
---
-title: Queueing a Series of State Updates
+title: Xử lí hàng đợi cho một chuỗi các cập nhật state liên tiếp
---
-Setting a state variable will queue another render. But sometimes you might want to perform multiple operations on the value before queueing the next render. To do this, it helps to understand how React batches state updates.
+Thiết lập một biến state sẽ đưa một lần render khác vào hàng đợi. Nhưng đôi khi bạn có thể muốn thực hiện nhiều thao tác trên giá trị đó trước khi đưa lần render tiếp theo vào hàng đợi. Để làm điều này, bạn nên hiểu cách React gom nhóm các cập nhật state.
-* What "batching" is and how React uses it to process multiple state updates
-* How to apply several updates to the same state variable in a row
+* "Batching" (gom nhóm) là gì và React sử dụng nó như thế nào để xử lý nhiều cập nhật state
+* Cách áp dụng liên tiếp nhiều cập nhật cho cùng một biến state
-## React batches state updates {/*react-batches-state-updates*/}
+## React gom nhóm các cập nhật state {/*react-batches-state-updates*/}
-You might expect that clicking the "+3" button will increment the counter three times because it calls `setNumber(number + 1)` three times:
+Bạn có thể nghĩ rằng việc nhấp vào nút "+3" sẽ tăng bộ đếm ba lần bởi vì nó gọi `setNumber(number + 1)` ba lần:
@@ -47,7 +47,7 @@ h1 { display: inline-block; margin: 10px; width: 30px; text-align: center; }
-However, as you might recall from the previous section, [each render's state values are fixed](/learn/state-as-a-snapshot#rendering-takes-a-snapshot-in-time), so the value of `number` inside the first render's event handler is always `0`, no matter how many times you call `setNumber(1)`:
+Tuy nhiên, như bạn có thể nhớ lại từ phần trước, [giá trị state của mỗi lần render được cố định](/learn/state-as-a-snapshot#rendering-takes-a-snapshot-in-time), vì vậy giá trị của `number` bên trong event handler của lần render đầu tiên luôn là `0`, bất kể bạn gọi `setNumber(1)` bao nhiêu lần:
```js
setNumber(0 + 1);
@@ -55,21 +55,21 @@ setNumber(0 + 1);
setNumber(0 + 1);
```
-But there is one other factor at play here. **React waits until *all* code in the event handlers has run before processing your state updates.** This is why the re-render only happens *after* all these `setNumber()` calls.
+Nhưng có một yếu tố khác đang tác động ở đây. **React chờ đợi cho đến khi *tất cả* code trong các event handler đã chạy xong trước khi xử lý các cập nhật state của bạn.** Đây là lý do tại sao việc render lại chỉ xảy ra *sau* tất cả các lệnh gọi `setNumber()` này.
-This might remind you of a waiter taking an order at the restaurant. A waiter doesn't run to the kitchen at the mention of your first dish! Instead, they let you finish your order, let you make changes to it, and even take orders from other people at the table.
+Điều này có thể gợi nhớ đến một người phục vụ nhận đơn hàng tại nhà hàng. Người phục vụ không chạy đến bếp ngay khi nghe thấy món đầu tiên của bạn! Thay vào đó, họ để bạn hoàn thành đơn hàng, để bạn thực hiện các thay đổi, và thậm chí nhận đơn hàng từ những người khác tại bàn.
-This lets you update multiple state variables--even from multiple components--without triggering too many [re-renders.](/learn/render-and-commit#re-renders-when-state-updates) But this also means that the UI won't be updated until _after_ your event handler, and any code in it, completes. This behavior, also known as **batching,** makes your React app run much faster. It also avoids dealing with confusing "half-finished" renders where only some of the variables have been updated.
+Điều này cho phép bạn cập nhật nhiều biến state--thậm chí từ nhiều component--mà không kích hoạt quá nhiều [lần render lại.](/learn/render-and-commit#re-renders-when-state-updates) Nhưng điều này cũng có nghĩa là UI sẽ không được cập nhật cho đến _sau_ khi event handler của bạn, và bất kỳ code nào trong đó, hoàn thành. Hành vi này, còn được gọi là **batching,** làm cho ứng dụng React của bạn chạy nhanh hơn nhiều. Nó cũng tránh việc phải đối phó với các lần render "chưa hoàn thành" gây nhầm lẫn khi chỉ một số biến được cập nhật.
-**React does not batch across *multiple* intentional events like clicks**--each click is handled separately. Rest assured that React only does batching when it's generally safe to do. This ensures that, for example, if the first button click disables a form, the second click would not submit it again.
+**React không gom nhóm qua *nhiều* sự kiện có chủ ý như click**--mỗi click được xử lý riêng biệt. Hãy yên tâm rằng React chỉ thực hiện batching khi nó thường an toàn để làm như vậy. Điều này đảm bảo rằng, ví dụ, nếu click nút đầu tiên vô hiệu hóa một form, click thứ hai sẽ không gửi nó lần nữa.
-## Updating the same state multiple times before the next render {/*updating-the-same-state-multiple-times-before-the-next-render*/}
+## Cập nhật cùng một state nhiều lần trước lần render tiếp theo {/*updating-the-same-state-multiple-times-before-the-next-render*/}
-It is an uncommon use case, but if you would like to update the same state variable multiple times before the next render, instead of passing the *next state value* like `setNumber(number + 1)`, you can pass a *function* that calculates the next state based on the previous one in the queue, like `setNumber(n => n + 1)`. It is a way to tell React to "do something with the state value" instead of just replacing it.
+Đây là một trường hợp sử dụng không phổ biến, nhưng nếu bạn muốn cập nhật cùng một biến state nhiều lần trước lần render tiếp theo, thay vì truyền *giá trị state tiếp theo* như `setNumber(number + 1)`, bạn có thể truyền một *function* tính toán state tiếp theo dựa trên state trước đó trong hàng đợi, như `setNumber(n => n + 1)`. Đây là cách để nói với React "làm điều gì đó với giá trị state" thay vì chỉ thay thế nó.
-Try incrementing the counter now:
+Hãy thử tăng bộ đếm ngay bây giờ:
@@ -99,10 +99,10 @@ h1 { display: inline-block; margin: 10px; width: 30px; text-align: center; }
-Here, `n => n + 1` is called an **updater function.** When you pass it to a state setter:
+Ở đây, `n => n + 1` được gọi là **updater (cập nhật) function.** Khi bạn truyền nó cho một state setter:
-1. React queues this function to be processed after all the other code in the event handler has run.
-2. During the next render, React goes through the queue and gives you the final updated state.
+1. React đưa function này vào hàng đợi để được xử lý sau khi tất cả code khác trong event handler đã chạy.
+2. Trong lần render tiếp theo, React duyệt qua hàng đợi và cung cấp cho bạn state cuối cùng đã cập nhật.
```js
setNumber(n => n + 1);
@@ -110,26 +110,27 @@ setNumber(n => n + 1);
setNumber(n => n + 1);
```
-Here's how React works through these lines of code while executing the event handler:
+Đây là cách React xử lý các dòng code này khi thực thi event handler:
-1. `setNumber(n => n + 1)`: `n => n + 1` is a function. React adds it to a queue.
-1. `setNumber(n => n + 1)`: `n => n + 1` is a function. React adds it to a queue.
-1. `setNumber(n => n + 1)`: `n => n + 1` is a function. React adds it to a queue.
+1. `setNumber(n => n + 1)`: `n => n + 1` là một function. React thêm nó vào hàng đợi.
+1. `setNumber(n => n + 1)`: `n => n + 1` là một function. React thêm nó vào hàng đợi.
+1. `setNumber(n => n + 1)`: `n => n + 1` là một function. React thêm nó vào hàng đợi.
-When you call `useState` during the next render, React goes through the queue. The previous `number` state was `0`, so that's what React passes to the first updater function as the `n` argument. Then React takes the return value of your previous updater function and passes it to the next updater as `n`, and so on:
+Khi bạn gọi `useState` trong lần render tiếp theo, React duyệt qua hàng đợi. State `number` trước đó là `0`, vì vậy đó là giá trị React truyền cho updater function đầu tiên làm tham số `n`. Sau đó React lấy giá trị trả về của updater function trước đó và truyền nó cho updater tiếp theo làm `n`, và cứ thế:
-| queued update | `n` | returns |
+| cập nhật trong hàng đợi | `n` | trả về |
|--------------|---------|-----|
| `n => n + 1` | `0` | `0 + 1 = 1` |
| `n => n + 1` | `1` | `1 + 1 = 2` |
| `n => n + 1` | `2` | `2 + 1 = 3` |
-React stores `3` as the final result and returns it from `useState`.
+React lưu trữ `3` là kết quả cuối cùng và trả về nó từ `useState`.
-This is why clicking "+3" in the above example correctly increments the value by 3.
-### What happens if you update state after replacing it {/*what-happens-if-you-update-state-after-replacing-it*/}
+Đây là lý do tại sao việc nhấp "+3" trong ví dụ trên đúng cách tăng giá trị lên 3.
-What about this event handler? What do you think `number` will be in the next render?
+### Điều gì xảy ra nếu bạn cập nhật state sau khi thay thế nó {/*what-happens-if-you-update-state-after-replacing-it*/}
+
+Còn event handler này thì sao? Bạn nghĩ `number` sẽ là gì trong lần render tiếp theo?
```js