Skip to content

Commit ee3ceca

Browse files
committed
fixup! [DevTools] Activity slices in Suspense tab
1 parent fe34bef commit ee3ceca

File tree

2 files changed

+6
-7
lines changed
  • packages
    • react-devtools-shared/src/backend/fiber
    • react-devtools-shell/src/app/Segments

2 files changed

+6
-7
lines changed

packages/react-devtools-shared/src/backend/fiber/renderer.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,8 +1450,10 @@ export function attach(
14501450
hideElementsWithDisplayNames.clear();
14511451
hideElementsWithPaths.clear();
14521452
hideElementsWithEnvs.clear();
1453+
// Consider everything in the slice by default
14531454
activitySliceID = null;
14541455
activitySlice = null;
1456+
isInActivitySlice = true;
14551457
14561458
componentFilters.forEach(componentFilter => {
14571459
if (!componentFilter.isEnabled) {
@@ -1488,10 +1490,7 @@ export function attach(
14881490
activitySlice = nextActivitySlice;
14891491
isInActivitySlice = false;
14901492
} else {
1491-
// We're not filtering by activity slice after all. Consider everything
1492-
// to be in the slice.
1493-
isInActivitySlice = true;
1494-
activitySlice = null;
1493+
// We're not filtering by activity slice after all.
14951494
// TODO: This is not sent to the frontend.
14961495
componentFilter.isEnabled = false;
14971496
}

packages/react-devtools-shell/src/app/Segments/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function Page(): React.Node {
3939

4040
function InnerSegment({children}: {children: React.Node}): React.Node {
4141
return (
42-
<React.Suspense fallback={<p>Loading...</p>}>
42+
<React.Suspense name="InnerSegment" fallback={<p>Loading...</p>}>
4343
<h3>Inner Segment</h3>
4444
<section>{children}</section>
4545
<p>After inner</p>
@@ -50,7 +50,7 @@ function InnerSegment({children}: {children: React.Node}): React.Node {
5050
const cookies = deferred(200, 'Cookies: 🍪🍪🍪', 'cookies');
5151
function OuterSegment({children}: {children: React.Node}): React.Node {
5252
return (
53-
<React.Suspense fallback={<p>Loading outer</p>}>
53+
<React.Suspense name="OuterSegment" fallback={<p>Loading outer</p>}>
5454
<h2>Outer Segment</h2>
5555
<p>{cookies}</p>
5656
<div>{children}</div>
@@ -61,7 +61,7 @@ function OuterSegment({children}: {children: React.Node}): React.Node {
6161

6262
function Root({children}: {children: React.Node}): React.Node {
6363
return (
64-
<React.Suspense fallback={<p>Loading root</p>}>
64+
<React.Suspense name="Root" fallback={<p>Loading root</p>}>
6565
<h1>Root Segment</h1>
6666
<main>{children}</main>
6767
<footer>After root</footer>

0 commit comments

Comments
 (0)