@samitouri / QOS-React-2 / commits / fb8ad3486e

Don't reorder a single child

Dan committed Apr 19, 2019 at 13:19 UTC fb8ad3486e70aa96d3e183db90b79bd915f474a5
1 file changed +4
src/backend/renderer.js
+4
@@ -937,6 +937,10 @@ export function attach(
937 }
938
939 const numChildren = nextChildren.length;
940 + if (numChildren === 1) {
941 + // No need to reorder a single child.
942 + return;
943 + }
944 beginNextOperation(3 + numChildren);
945 nextOperation[0] = TREE_OPERATION_REORDER_CHILDREN;
946 nextOperation[1] = getFiberID(getPrimaryFiber(fiber));