Skip to content

Commit 2e07386

Browse files
committed
nit
1 parent ac8e311 commit 2e07386

File tree

2 files changed

+33
-33
lines changed

2 files changed

+33
-33
lines changed

src/content/blog/2025/10/01/react-19-2.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,35 @@ For a deep dive on how to think about Event Effects, see: [Separating Events fro
112112
113113
---
114114
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+
const dedupedFetch = cache(fetch);
128+
129+
async function Component() {
130+
await dedupedFetch(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+
115144
### Performance Tracks {/*performance-tracks*/}
116145
117146
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
198227
199228
---
200229
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-
const dedupedFetch = cache(fetch);
214-
215-
async function Component() {
216-
await dedupedFetch(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-
230230
## Notable Changes {/*notable-changes*/}
231231
232232
### Batching Suspense Boundaries for SSR {/*batching-suspense-boundaries-for-ssr*/}

src/content/reference/react/cacheSignal.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ title: cacheSignal
44

55
<RSC>
66

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).
88

99
</RSC>
1010

1111
<Intro>
1212

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.
1414

1515
```js
1616
const signal = cacheSignal();
@@ -37,7 +37,7 @@ async function Component() {
3737

3838
When React has finished rendering, the `AbortSignal` will be aborted. This allows you to cancel any in-flight work that is no longer needed.
3939
Rendering is considered finished when:
40-
- React has successfully completed rendering
40+
- React has successfully completed rendering
4141
- the render was aborted
4242
- the render has failed
4343

@@ -110,4 +110,4 @@ async function Component({id}) {
110110
}
111111
return <div>{data.name}</div>;
112112
}
113-
```
113+
```

0 commit comments

Comments
 (0)