[DevTools] Check suspense child node presence in parentSuspense.children before removing (#35775)

Currently, this silently removes the last child in the list, which
doesn't contain the `id`.
This commit is contained in:
Ruslan Lesiutin
2026-02-13 15:33:22 +00:00
committed by GitHub
parent 6066c782fe
commit 03ca38e6e7

View File

@@ -1873,6 +1873,13 @@ export default class Store extends EventEmitter<{
}
const index = parentSuspense.children.indexOf(id);
if (index === -1) {
this._throwAndEmitError(
Error(
`Cannot remove suspense node "${id}" from parent "${parentID}" because it is not a child of the parent.`,
),
);
}
parentSuspense.children.splice(index, 1);
}
}