From 1b20061b1097c11a4c30387a487980801c89e73d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rado=C5=A1=20Mili=C4=87ev?= <40705899+rammba@users.noreply.github.com> Date: Fri, 26 Sep 2025 18:15:37 +0200 Subject: [PATCH 1/2] Fix value wrongly formatted as code in useDeferredValue.md (#8024) --- src/content/reference/react/useDeferredValue.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/reference/react/useDeferredValue.md b/src/content/reference/react/useDeferredValue.md index bf716b1733..40cb92629b 100644 --- a/src/content/reference/react/useDeferredValue.md +++ b/src/content/reference/react/useDeferredValue.md @@ -420,7 +420,7 @@ input { margin: 10px; } You can think of it as happening in two steps: -1. **First, React re-renders with the new `query` (`"ab"`) but with the old `deferredQuery` (still `"a")`.** The `deferredQuery` value, which you pass to the result list, is *deferred:* it "lags behind" the `query` value. +1. **First, React re-renders with the new `query` (`"ab"`) but with the old `deferredQuery` (still `"a"`).** The `deferredQuery` value, which you pass to the result list, is *deferred:* it "lags behind" the `query` value. 2. **In the background, React tries to re-render with *both* `query` and `deferredQuery` updated to `"ab"`.** If this re-render completes, React will show it on the screen. However, if it suspends (the results for `"ab"` have not loaded yet), React will abandon this rendering attempt, and retry this re-render again after the data has loaded. The user will keep seeing the stale deferred value until the data is ready. From 07d1d3e03950ad525885eb9ace9784bfa13b7895 Mon Sep 17 00:00:00 2001 From: Xleine Date: Sun, 28 Sep 2025 16:59:34 +0800 Subject: [PATCH 2/2] fix conflict --- src/content/reference/react/useDeferredValue.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/content/reference/react/useDeferredValue.md b/src/content/reference/react/useDeferredValue.md index 003114ba72..551867ed9f 100644 --- a/src/content/reference/react/useDeferredValue.md +++ b/src/content/reference/react/useDeferredValue.md @@ -420,11 +420,7 @@ input { margin: 10px; } 你可以将其看成两个步骤: -<<<<<<< HEAD -1. **首先,React 会使用新的 `query` 值(`"ab"`)和旧的 `deferredQuery` 值(仍为 `"a"`)重新渲染。** 传递给结果列表的 `deferredQuery` 值是**延迟**的,它“滞后于” `query` 值。 -======= -1. **First, React re-renders with the new `query` (`"ab"`) but with the old `deferredQuery` (still `"a"`).** The `deferredQuery` value, which you pass to the result list, is *deferred:* it "lags behind" the `query` value. ->>>>>>> 1b20061b1097c11a4c30387a487980801c89e73d +1. **首先,React 会使用新的 `query` 值(`"ab"`)和旧的 `deferredQuery` 值(仍为 `"a"`)重新渲染。** 传递给结果列表的 `deferredQuery` 值是 **延迟** 的,它“滞后于” `query` 值。 2. **在后台,React 尝试重新渲染,并将 `query` 和 `deferredQuery` 两个值都更新为 `"ab"`。** 如果此次重新渲染完成,React 将在屏幕上显示它。但是,如果它 suspense(即 `"ab"` 的结果尚未加载),React 将放弃这次渲染,并在数据加载后再次尝试重新渲染。用户将一直看到旧的延迟值,直到数据准备就绪。