react/react · error · Error

Expected a placed child to be moved from the remaining set.

Error message

Expected a placed child to be moved from the remaining set.

What it means

Thrown in removeChild when previousSibling is null (meaning this instance should be the head of the remainingReconcilingChildren list) but remainingReconcilingChildren !== instance. The remaining-children list is a singly-linked list where the head is tracked by the remainingReconcilingChildren variable. If the caller says 'this is the first child' (previousSibling === null) but the list head points elsewhere, the linked list has become inconsistent — the instance is not where the caller expects it to be.

Source

Thrown at packages/react-devtools-shared/src/backend/fiber/renderer.js:2503

      }
      // Already deleted.
      return;
    }
    const parentInstance = reconcilingParent;
    if (parentInstance === null) {
      throw new Error('Should not have a parent if we are at the root');
    }
    if (instance.parent !== parentInstance) {
      throw new Error(
        'Cannot remove a node from a different parent than is being reconciled.',
      );
    }
    // Remove an existing child from its current position, which we assume is in the
    // remainingReconcilingChildren set.
    if (previousSibling === null) {
      // We're first in the remaining set. Remove us.
      if (remainingReconcilingChildren !== instance) {
        throw new Error(
          'Expected a placed child to be moved from the remaining set.',
        );
      }
      remainingReconcilingChildren = instance.nextSibling;
    } else {
      previousSibling.nextSibling = instance.nextSibling;
    }
    instance.nextSibling = null;
    instance.parent = null;

    // Remove any SuspenseNode from its parent.
    const suspenseNode = instance.suspenseNode;
    if (suspenseNode !== null && suspenseNode.parent !== null) {
      const parentNode = reconcilingParentSuspenseNode;
      if (parentNode === null) {
        throw new Error('Should not have a parent if we are at the root');
      }
      if (suspenseNode.parent !== parentNode) {

View on GitHub (pinned to 22e4f993c7)

Solutions

  1. Update React DevTools to the latest version.
  2. Reduce key-list reordering complexity and check if the issue is triggered by specific key patterns.
  3. Report the issue with the list-reordering scenario that triggers it.
Defensive patterns

Strategy: validation

Validate before calling

// Before unlinking as head, verify the list head matches
if (previousSibling === null && remainingReconcilingChildren !== instance) {
  // List head mismatch — search for the instance instead of assuming head
  return;
}

Type guard

function isRemainingChildrenHead(instance: DevToolsInstance): boolean {
  return remainingReconcilingChildren === instance;
}

Prevention

When it happens

Trigger: removeChild is called with previousSibling === null, indicating the instance is first in the remaining set, but remainingReconcilingChildren points to a different instance. This means the remaining-children list head was updated (or corrupted) independently of this removal request.

Common situations: Linked-list pointer corruption during child reordering; multiple passes touching the same remaining-children list; DevTools internal state desync during rapid reconciliation of key lists.

Related errors


AI-assisted analysis of react/react@22e4f993c7 (2026-08-12). Data as JSON: /api/errors/00efb35d5ddf0b4e. Report an issue: GitHub.