facebook/react · error · Error
The children should not have changed if we pass in the same
Error message
The children should not have changed if we pass in the same set.
What it means
Diffing invariant in updateChildrenRecursively's keyed-set fast path: when the parent passes the exact same child set, the recursive child update is expected to bail out without requesting a child reset (ShouldResetChildren). Getting that flag anyway means filtered-fiber bookkeeping diverged - a child decided the set membership changed even though the caller asserted it identical.
Source
Thrown at packages/react-devtools-shared/src/backend/fiber/renderer.js:4766
// we should fall back to recursively marking the nearest host descendants for highlight.
if (traceNearestHostComponentUpdate) {
const hostInstances =
findAllCurrentHostInstances(fiberInstance);
hostInstances.forEach(hostInstance => {
traceUpdatesForNodes.add(hostInstance);
});
}
}
} else {
const childrenUpdateFlags = updateChildrenRecursively(
nextFiber.child,
prevFiber.child,
false,
);
// If this fiber is filtered there might be changes to this set elsewhere so we have
// to visit each child to place it back in the set. We let the child bail out instead.
if ((childrenUpdateFlags & ShouldResetChildren) !== NoUpdate) {
throw new Error(
'The children should not have changed if we pass in the same set.',
);
}
updateFlags |= childrenUpdateFlags;
}
}
}
if (fiberInstance !== null) {
// Detect Activity hidden/visible mode changes.
if (
prevFiber.tag === ActivityComponent &&
nextFiber.tag === ActivityComponent &&
fiberInstance.kind === FIBER_INSTANCE
) {
const prevOffscreen = prevFiber.child;
const nextOffscreen = nextFiber.child;
if (prevOffscreen !== null && nextOffscreen !== null) {View on GitHub (pinned to eafeac097b)
Solutions
- Update React DevTools to the latest build
- Clear or simplify component filters and reload the page, then retry the update
- Re-report with the active filters and the component tree shape if it persists
- Disable the Components panel temporarily to confirm the error source
Defensive patterns
Strategy: try-catch
Try / catch
try {
backend.handleCommitFiberRoot(renderer, root);
} catch (e) {
if (/children should not have changed if we pass in the same set/.test(e.message)) {
clearFiltersAndRemount(root); // filtered-set bookkeeping diverged
} else throw e;
} Prevention
- Update DevTools; keyed-set/filtered-fiber placement logic is fixed across releases
- Simplify or clear component filters and reload before blaming app code
- Avoid toggling filters mid-session and then committing updates
- Report the filter configuration plus tree shape with the repro
When it happens
Trigger: Components filtered out by DevTools' component filters interacting with keyed children sets; toggling filters while updates commit; version skew in the filtered-instance placement logic between commits.
Common situations: Using DevTools component filters (hide by name/type) on trees whose children reconcile as keyed sets; changing filter settings mid-session and then triggering updates.
Related errors
- The should not be any remaining suspense node children if th
- There should always be an Offscreen Fiber child in a hydrate
- Did not expect a host hoistable to be the root
- A dehydrated Suspense node should not have a content Fiber.
- Encountered a dehydrated Suspense boundary that was previous
AI-assisted analysis of facebook/react@eafeac097b (2026-08-21).
Data as JSON: /api/errors/7b0b6fa479ba50b9.
Report an issue: GitHub.