You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/blog/2025/10/01/react-19-2.md
+29-29Lines changed: 29 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,6 +112,35 @@ For a deep dive on how to think about Event Effects, see: [Separating Events fro
112
112
113
113
---
114
114
115
+
### `cacheSignal` {/*cache-signal*/}
116
+
117
+
<RSC>
118
+
119
+
`cacheSignal` is only for use with [React Server Components](/reference/rsc/server-components).
120
+
121
+
</RSC>
122
+
123
+
`cacheSignal` allows you to know when the [`cache()`](/reference/react/cache) lifetime is over:
124
+
125
+
```
126
+
import {cache, cacheSignal} from'react';
127
+
constdedupedFetch=cache(fetch);
128
+
129
+
asyncfunctionComponent() {
130
+
awaitdedupedFetch(url, { signal:cacheSignal() });
131
+
}
132
+
```
133
+
134
+
This allows you to clean up or abort work when the result will no longer be used in the cache, such as:
135
+
136
+
- React has successfully completed rendering
137
+
- The render was aborted
138
+
- The render has failed
139
+
140
+
For more info, see the [`cacheSignal` docs](/reference/react/cacheSignal).
141
+
142
+
---
143
+
115
144
### Performance Tracks {/*performance-tracks*/}
116
145
117
146
React 19.2 adds a new set of [custom tracks](https://developer.chrome.com/docs/devtools/performance/extension) to Chrome DevTools performance profiles to provide more information about the performance of your React app:
@@ -198,35 +227,6 @@ Additionally, the prerender apis now return a `postpone` state to pass to the `r
198
227
199
228
---
200
229
201
-
### `cacheSignal` {/*cache-signal*/}
202
-
203
-
<RSC>
204
-
205
-
`cacheSignal` is only for use with [React Server Components](/reference/rsc/server-components).
206
-
207
-
</RSC>
208
-
209
-
`cacheSignal` allows you to know when the [`cache()`](/reference/react/cache) lifetime is over:
210
-
211
-
```
212
-
import {cache, cacheSignal} from'react';
213
-
constdedupedFetch=cache(fetch);
214
-
215
-
asyncfunctionComponent() {
216
-
awaitdedupedFetch(url, { signal:cacheSignal() });
217
-
}
218
-
```
219
-
220
-
This allows you to clean up or abort work when the result will no longer be used in the cache, such as:
221
-
222
-
- React has successfully completed rendering
223
-
- The render was aborted
224
-
- The render has failed
225
-
226
-
For more info, see the [`cacheSignal` docs](/reference/react/cacheSignal).
227
-
228
-
---
229
-
230
230
## Notable Changes {/*notable-changes*/}
231
231
232
232
### Batching Suspense Boundaries for SSR {/*batching-suspense-boundaries-for-ssr*/}
Copy file name to clipboardExpand all lines: src/content/reference/react/cacheSignal.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,13 @@ title: cacheSignal
4
4
5
5
<RSC>
6
6
7
-
`cacheSignal` is currently only used with [React Server Components](/blog/2023/03/22/react-labs-what-we-have-been-working-on-march-2023#react-server-components).
7
+
`cacheSignal` is currently only used with [React Server Components](/blog/2023/03/22/react-labs-what-we-have-been-working-on-march-2023#react-server-components).
8
8
9
9
</RSC>
10
10
11
11
<Intro>
12
12
13
-
`cacheSignal` allows you to know when the `cache()`life time is over.
13
+
`cacheSignal` allows you to know when the `cache()`lifetime is over.
14
14
15
15
```js
16
16
constsignal=cacheSignal();
@@ -37,7 +37,7 @@ async function Component() {
37
37
38
38
When React has finished rendering, the `AbortSignal` will be aborted. This allows you to cancel any in-flight work that is no longer needed.
39
39
Rendering is considered finished when:
40
-
- React has successfully completed rendering
40
+
- React has successfully completed rendering
41
41
- the render was aborted
42
42
- the render has failed
43
43
@@ -110,4 +110,4 @@ async function Component({id}) {
0 commit comments