Skip to content

Commit 2b94baf

Browse files
committed
Disable pane for now
Can be handled as a follow-up
1 parent 2e7c732 commit 2b94baf

File tree

1 file changed

+3
-18
lines changed
  • packages/react-devtools-shared/src/devtools/views/SuspenseTab

1 file changed

+3
-18
lines changed

packages/react-devtools-shared/src/devtools/views/SuspenseTab/SuspenseTab.js

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import ButtonIcon, {type IconType} from '../ButtonIcon';
2727
import InspectHostNodesToggle from '../Components/InspectHostNodesToggle';
2828
import InspectedElementErrorBoundary from '../Components/InspectedElementErrorBoundary';
2929
import InspectedElement from '../Components/InspectedElement';
30-
import {TreeStateContext} from '../Components/TreeContext';
3130
import portaledContent from '../portaledContent';
3231
import styles from './SuspenseTab.css';
3332
import SuspenseBreadcrumbs from './SuspenseBreadcrumbs';
@@ -45,7 +44,6 @@ import typeof {SyntheticPointerEvent} from 'react-dom-bindings/src/events/Synthe
4544
import SettingsModal from 'react-devtools-shared/src/devtools/views/Settings/SettingsModal';
4645
import SettingsModalContextToggle from 'react-devtools-shared/src/devtools/views/Settings/SettingsModalContextToggle';
4746
import {SettingsModalContextController} from 'react-devtools-shared/src/devtools/views/Settings/SettingsModalContext';
48-
import {ElementTypeActivity} from 'react-devtools-shared/src/frontend/types';
4947

5048
type Orientation = 'horizontal' | 'vertical';
5149

@@ -164,22 +162,10 @@ function ToggleInspectedElement({
164162
// TODO: Get this from the store directly.
165163
// The backend needs to keep a separate tree so that resuspending keeps Activity around.
166164
function useActivities(): $ReadOnlyArray<Element> {
167-
const {numElements} = useContext(TreeStateContext);
168-
const store = useContext(StoreContext);
169-
170165
const activities = useMemo(() => {
171-
const items = [];
172-
for (let i = 0; i < numElements; i++) {
173-
const element = store.getElementAtIndex(i);
174-
if (element === null) {
175-
continue;
176-
}
177-
if (element.type === ElementTypeActivity && element.nameProp !== null) {
178-
items.push(element);
179-
}
180-
}
166+
const items: Array<Element> = [];
181167
return items;
182-
}, [numElements]);
168+
}, []);
183169

184170
return activities;
185171
}
@@ -195,8 +181,7 @@ function SuspenseTab(_: {}) {
195181

196182
const activities = useActivities();
197183
// If there are no named Activity boundaries, we don't have any tree list and we should hide
198-
// both the panel and the button to toggle it. Since we currently don't support it yet, it's
199-
// always disabled.
184+
// both the panel and the button to toggle it.
200185
const treeListDisabled = activities.length === 0;
201186

202187
const wrapperTreeRef = useRef<null | HTMLElement>(null);

0 commit comments

Comments
 (0)