);
}
+
+export default function SuspenseTimeline(): React$Node {
+ const store = useContext(StoreContext);
+ const {shells} = useContext(SuspenseTreeStateContext);
+
+ const defaultSelectedRootID = shells.find(rootID => {
+ const suspense = store.getSuspenseByID(rootID);
+ return (
+ store.supportsTogglingSuspense(rootID) &&
+ suspense !== null &&
+ suspense.children.length > 1
+ );
+ });
+ const [selectedRootID, setSelectedRootID] = useState(defaultSelectedRootID);
+
+ if (selectedRootID === undefined && defaultSelectedRootID !== undefined) {
+ setSelectedRootID(defaultSelectedRootID);
+ }
+
+ function handleChange(event: SyntheticEvent) {
+ const newRootID = +event.currentTarget.value;
+ // TODO: scrollIntoView both suspense rects and host instance.
+ setSelectedRootID(newRootID);
+ }
+
+ return (
+
+
+ {shells.length > 0 && (
+
+ )}
+
+ );
+}
diff --git a/packages/react-devtools-shared/src/utils.js b/packages/react-devtools-shared/src/utils.js
index 34c258ebe2..b404608e55 100644
--- a/packages/react-devtools-shared/src/utils.js
+++ b/packages/react-devtools-shared/src/utils.js
@@ -261,6 +261,7 @@ export function printOperationsArray(operations: Array
) {
i++; // supportsProfiling
i++; // supportsStrictMode
i++; // hasOwnerMetadata
+ i++; // supportsTogglingSuspense
} else {
const parentID = ((operations[i]: any): number);
i++;