Skip to content

Commit d45577e

Browse files
authored
docs: add translate in cache.md (#1861)
2 parents 672ae3a + 85a49e4 commit d45577e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/content/reference/react/cache.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ function TeamReport({users}) {
101101

102102
`TeamReport` 使用相同的 `user` 对象来渲染 `users` 列表时,它将调用 <CodeStep step={2}>`getUserMetrics`</CodeStep> 并从缓存中读取结果。
103103

104-
If `calculateUserMetrics` can be aborted by passing an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal), you can use [`cacheSignal()`](/reference/react/cacheSignal) to cancel the expensive computation if React has finished rendering. `calculateUserMetrics` may already handle cancellation internally by using `cacheSignal` directly.
104+
如果可以通过传递 [`AbortSignal`](https://developer.mozilla.org/zh-CN/docs/Web/API/AbortSignal) 来中止 `calculateUserMetrics`,则可以使用 [`cacheSignal()`](/reference/react/cacheSignal),以便在 React 完成渲染后取消昂贵的计算。`calculateUserMetrics` 可以直接使用 `cacheSignal` 在内部处理取消。
105105

106106
<Pitfall>
107107

0 commit comments

Comments
 (0)