{"record":{"id":"7b0b6fa479ba50b9","repo":"facebook/react","slug":"the-children-should-not-have-changed-if-we-pass-in","errorCode":null,"errorMessage":"The children should not have changed if we pass in the same set.","messagePattern":"The children should not have changed if we pass in the same set\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-devtools-shared/src/backend/fiber/renderer.js","lineNumber":4766,"sourceCode":"              // we should fall back to recursively marking the nearest host descendants for highlight.\n              if (traceNearestHostComponentUpdate) {\n                const hostInstances =\n                  findAllCurrentHostInstances(fiberInstance);\n                hostInstances.forEach(hostInstance => {\n                  traceUpdatesForNodes.add(hostInstance);\n                });\n              }\n            }\n          } else {\n            const childrenUpdateFlags = updateChildrenRecursively(\n              nextFiber.child,\n              prevFiber.child,\n              false,\n            );\n            // If this fiber is filtered there might be changes to this set elsewhere so we have\n            // to visit each child to place it back in the set. We let the child bail out instead.\n            if ((childrenUpdateFlags & ShouldResetChildren) !== NoUpdate) {\n              throw new Error(\n                'The children should not have changed if we pass in the same set.',\n              );\n            }\n            updateFlags |= childrenUpdateFlags;\n          }\n        }\n      }\n\n      if (fiberInstance !== null) {\n        // Detect Activity hidden/visible mode changes.\n        if (\n          prevFiber.tag === ActivityComponent &&\n          nextFiber.tag === ActivityComponent &&\n          fiberInstance.kind === FIBER_INSTANCE\n        ) {\n          const prevOffscreen = prevFiber.child;\n          const nextOffscreen = nextFiber.child;\n          if (prevOffscreen !== null && nextOffscreen !== null) {","sourceCodeStart":4748,"sourceCodeEnd":4784,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-devtools-shared/src/backend/fiber/renderer.js#L4748-L4784","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  backend.handleCommitFiberRoot(renderer, root);\n} catch (e) {\n  if (/children should not have changed if we pass in the same set/.test(e.message)) {\n    clearFiltersAndRemount(root); // filtered-set bookkeeping diverged\n  } else throw e;\n}","preventionTips":["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"],"tags":["react-devtools","invariant","reconciliation","keyed-children","filters","internal"],"backgroundTag":"devtools-tree-traversal-invariant","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}