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
{{ message }}
Repository navigation
Commit 30d9a1f
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: src/content/reference/dev-tools/react-suspense-panel.md
+25-16Lines changed: 25 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,6 @@ The Suspense panel in React Developer Tools lets you inspect [`<Suspense>`](/ref
8
8
9
9
</Intro>
10
10
11
-
The Suspense panel combines a minimap of the Suspense boundaries on the page with an inspector and reveal timeline. Use it to select boundaries, inspect the work they waited for, preview their fallbacks, and replay the order in which their content appeared.
12
-
13
-
{/* TODO: Replace the screenshot placeholders before marking this PR ready. */}
14
-
15
11
<InlineToc />
16
12
17
13
---
@@ -32,26 +28,30 @@ The panel itself does not require React Canary. For complete information about w
32
28
33
29
</Note>
34
30
35
-
The examples on this page run inside embedded frames. The screenshots show how each example appears in the Suspense panel. To inspect an example interactively, fork it and open its preview as a separate page. The examples use small Promise caches to demonstrate suspension. In an app, use a [Suspense-enabled framework or data source](/reference/react/Suspense#suspense-enabled-frameworks).
31
+
The examples on this page run inside embedded frames. The screenshots show how each example appears in the Suspense panel. To inspect an example interactively, fork it and open its preview as a separate page.
32
+
33
+
The examples use small Promise caches to demonstrate suspension. In an app, use a [Suspense-enabled framework or data source](/reference/react/Suspense#suspense-enabled-frameworks).
36
34
37
35
---
38
36
39
37
## Panel features {/*panel-features*/}
40
38
41
39
### Navigating the panel {/*navigating-the-panel*/}
42
40
43
-
The panel has a minimap and reveal timeline on the left and an inspector on the right. Drag the divider to resize them. You can also hide the inspector from the toolbar. DevTools remembers the layout between sessions.
41
+
The panel has a minimap and reveal timeline on the left and an inspector on the right. Drag the divider to resize them. You can also hide the inspector from the toolbar. The panel remembers the layout between sessions.
44
42
45
43
The toolbar also includes controls for selecting a Suspense boundary from the page, navigating through nested boundaries, filtering the minimap, and opening the React Developer Tools settings.
46
44
45
+
{/* TODO: Replace the screenshot placeholders before marking this PR ready. */}
<imgclassName="light-image"src="/images/docs/suspense-panel/overview.png"alt="The Suspense panel showing a minimap of the page's boundaries, details for a selected boundary, and the reveal timeline." />
49
-
<imgclassName="dark-image"src="/images/docs/suspense-panel/overview.dark.png"alt="The Suspense panel showing a minimap of the page's boundaries, details for a selected boundary, and the reveal timeline." />
48
+
<imgclassName="w-full light-image"src="/images/docs/suspense-panel/overview.png"alt="The Suspense panel showing a minimap of the page's boundaries, details for a selected boundary, and the reveal timeline." />
49
+
<imgclassName="w-full dark-image"src="/images/docs/suspense-panel/overview.dark.png"alt="The Suspense panel showing a minimap of the page's boundaries, details for a selected boundary, and the reveal timeline." />
The main view is a minimap of the Suspense boundaries on the page. Each outlined region represents the content inside a boundary and matches its position on the page. Blue boundaries rendered on the client, green boundaries rendered on the server, and yellow boundaries rendered in another named environment.
54
+
The main view is a minimap of the Suspense boundaries on the page. Each outlined region represents the content inside a boundary and matches its position on the page. Blue indicates client-rendered boundaries, green indicates server-rendered boundaries, and yellow indicates boundaries rendered in another named environment. The timeline label shows the environment's name.
55
55
56
56
This example contains an outer boundary for the artist details and a nested boundary for the albums:
57
57
@@ -184,9 +184,16 @@ function wait(ms) {
184
184
185
185
</Sandpack>
186
186
187
-
Hover over a region in the minimap to highlight its content on the page. Select a region to inspect that boundary. Double-click it to alternate between the timeline steps immediately before and after React revealed its content. Select the minimap background to inspect the root, or double-click it to return to the initial paint. For nested boundaries, use the breadcrumbs above the minimap to move through their hierarchy.
187
+
Use the minimap to find and inspect boundaries:
188
+
189
+
- Hover over a region to highlight its content on the page.
190
+
- Select a region to inspect that boundary.
191
+
- Double-click a region to alternate between the timeline steps immediately before and after React revealed its content.
192
+
- Select the minimap background to inspect the root, or double-click it to return to the initial paint.
188
193
189
-
You can also select **Inspect Suspense Nodes** in the toolbar, and then select content on the page. DevTools selects the nearest Suspense boundary.
194
+
For nested boundaries, use the breadcrumbs above the minimap to move through their hierarchy.
195
+
196
+
You can also select **Inspect Suspense Nodes** in the toolbar, then select content on the page. The panel selects the nearest Suspense boundary.
<imgclassName="w-full light-image"src="/images/docs/suspense-panel/boundary-map.png"alt="Nested Suspense boundaries in the panel minimap." />
@@ -279,12 +286,14 @@ async function getBiography() {
279
286
280
287
</Sandpack>
281
288
282
-
With a development build of React 19.2 or later, DevTools can show causes such as `lazy`, Promises read with `use`, and resources including stylesheets, fonts, and images. Each cause includes a time bar. Hover over it to see how long the work took and, for a resource, its size. Expand a cause to inspect where the work started and where React awaited it, the Components involved, and the resolved or rejected value. Consecutive causes with the same name are grouped together.
289
+
The **Suspended by** section can show causes such as Components loaded with `lazy`, Promises read with `use`, and resources including stylesheets, fonts, and images.
283
290
284
-
While a boundary is still waiting, the inspector displays **suspended...** until the cause finishes loading. If React could not retain the information needed to identify a cause, the inspector explains whether this is because of the React version, a production build, or a Promise thrown without `use`.
291
+
Each cause includes a time bar. Hover over it to see how long the work took and, for a resource, its size. Expand a cause to inspect where the work started and where React awaited it, the Components involved, and the resolved or rejected value. Consecutive causes with the same name are grouped together.
285
292
286
293
Select the clipboard button in the **Suspended by** heading to copy all suspension data.
287
294
295
+
While a boundary is still waiting, the inspector displays **suspended...** until the work completes. If React could not retain the information needed to identify a cause, the inspector explains whether this is because of the React version, a production build, or a Promise thrown without `use`.
<imgclassName="w-full light-image"src="/images/docs/suspense-panel/suspended-by.png"alt="The Suspended by section for a selected Suspense boundary." />
290
299
<imgclassName="w-full dark-image"src="/images/docs/suspense-panel/suspended-by.dark.png"alt="The Suspended by section for a selected Suspense boundary." />
@@ -417,7 +426,7 @@ async function loadProfile() {
417
426
418
427
</Sandpack>
419
428
420
-
The suspend control is disabled while the boundary is waiting for its content to load.
429
+
**Suspend the selected component** is disabled while the boundary is waiting for its content to load.
<imgclassName="w-full light-image"src="/images/docs/suspense-panel/forced-fallback.png"alt="A selected Suspense boundary displaying its fallback after it was suspended from the panel." />
@@ -667,6 +676,6 @@ If the page contains a boundary but it does not appear, turn off **Unique Suspen
667
676
668
677
### I can't see what caused a boundary to suspend {/*i-cant-see-what-caused-a-boundary-to-suspend*/}
669
678
670
-
Use a development build of React 19.2 or later to see complete information about suspension causes. Production builds and older versions of React may not retain all the debugging information that the panel needs.
679
+
If some cause information is missing, inspect a development build of React 19.2 or later.
671
680
672
-
If the inspector says that something threw a Promise, DevTools cannot identify the cause as precisely. If you control the data source, provide the Promise to [`use`](/reference/react/use) instead of throwing it directly.
681
+
If the inspector says that something threw a Promise, it cannot show exactly which work suspended the boundary. If you control the data source, provide the Promise to [`use`](/reference/react/use) instead of throwing it directly.
0 commit comments