Don't reorder a single child

This commit is contained in:
Dan
2019-04-19 13:19:58 +01:00
parent 2adbfd9607
commit fb8ad3486e
+4
View File
@@ -937,6 +937,10 @@ export function attach(
}
const numChildren = nextChildren.length;
if (numChildren === 1) {
// No need to reorder a single child.
return;
}
beginNextOperation(3 + numChildren);
nextOperation[0] = TREE_OPERATION_REORDER_CHILDREN;
nextOperation[1] = getFiberID(getPrimaryFiber(fiber));