+
+ {isOpen &&
+ suspendedBy.map(({value, index}) => (
+
+ ))}
+
+ );
+}
+
export default function InspectedElementSuspendedBy({
bridge,
element,
@@ -390,6 +498,27 @@ export default function InspectedElementSuspendedBy({
suspendedBy === null ? [] : suspendedBy.map(withIndex);
sortedSuspendedBy.sort(compareTime);
+ // Organize into groups of consecutive entries with the same name.
+ const groups = [];
+ let currentGroup = null;
+ let currentGroupName = null;
+ for (let i = 0; i < sortedSuspendedBy.length; i++) {
+ const entry = sortedSuspendedBy[i];
+ const name = entry.value.awaited.name;
+ if (
+ currentGroupName !== name ||
+ !name ||
+ name === 'Promise' ||
+ currentGroup === null
+ ) {
+ // Create a new group.
+ currentGroupName = name;
+ currentGroup = [];
+ groups.push(currentGroup);
+ }
+ currentGroup.push(entry);
+ }
+
let unknownSuspenders = null;
switch (inspectedElement.unknownSuspenders) {
case UNKNOWN_SUSPENDERS_REASON_PRODUCTION:
@@ -430,19 +559,48 @@ export default function InspectedElementSuspendedBy({