mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Get rid of DEV only invariant
This commit is contained in:
1 parent
a1ef4c4391
commit
b338c75c28
1 file changed
+7
-9
@@ -806,15 +806,13 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) {
|
||||
// First, validate keys.
|
||||
// We'll get a different iterator later for the main pass.
|
||||
const newChildren = iteratorFn.call(newChildrenIterable);
|
||||
invariant(
|
||||
newChildren != null,
|
||||
'An iterable object provided no iterator.'
|
||||
);
|
||||
let knownKeys = null;
|
||||
let step = newChildren.next();
|
||||
for (; !step.done; step = newChildren.next()) {
|
||||
const child = step.value;
|
||||
knownKeys = warnOnDuplicateKey(child, knownKeys);
|
||||
if (newChildren) {
|
||||
let knownKeys = null;
|
||||
let step = newChildren.next();
|
||||
for (; !step.done; step = newChildren.next()) {
|
||||
const child = step.value;
|
||||
knownKeys = warnOnDuplicateKey(child, knownKeys);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user