Revert "[DevTools] Always include the root in the timeline and select it by default" (#34739)
Reverts facebook/react#34654
Ruslan Lesiutin committed
Oct 5, 2025 at 13:35 UTC
62ff1e61fce3eca9346716715679e7604477d84d
1 file changed
-16
packages/react-devtools-shared/src/devtools/views/SuspenseTab/SuspenseTab.js
-16
@@ -34,10 +34,6 @@ import {
34
SuspenseTreeStateContext,
35
} from './SuspenseTreeContext';
36
import {StoreContext, OptionsContext} from '../context';
37
-import {
38
- TreeDispatcherContext,
39
- TreeStateContext,
40
-} from '../Components/TreeContext';
37
import Button from '../Button';
38
import Toggle from '../Toggle';
39
import typeof {SyntheticPointerEvent} from 'react-dom-bindings/src/events/SyntheticEvent';
@@ -185,18 +181,6 @@ function SuspenseTab(_: {}) {
181
treeListHorizontalFraction,
182
} = state;
183
188
- const {inspectedElementID} = useContext(TreeStateContext);
189
- const {timeline} = useContext(SuspenseTreeStateContext);
190
- const treeDispatch = useContext(TreeDispatcherContext);
191
- useLayoutEffect(() => {
192
- // If the inspected element is still null and we've loaded a timeline, we can set the initial selection.
193
- // TODO: This tab should use its own source of truth instead so we only show suspense boundaries.
194
- if (inspectedElementID === null && timeline.length > 0) {
195
- const milestone = timeline[timeline.length - 1];
196
- treeDispatch({type: 'SELECT_ELEMENT_BY_ID', payload: milestone});
197
- }
198
- }, [timeline, inspectedElementID]);
199
-
184
useLayoutEffect(() => {
185
const wrapperElement = wrapperTreeRef.current;
186