We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 89b6109 commit 8e5adfbCopy full SHA for 8e5adfb
packages/react-reconciler/src/ReactFiberLane.js
@@ -640,7 +640,13 @@ export function higherLanePriority(
640
}
641
642
export function createLaneMap<T>(initial: T): LaneMap<T> {
643
- return new Array(TotalLanes).fill(initial);
+ // Intentionally pushing one by one.
644
+ // https://v8.dev/blog/elements-kinds#avoid-creating-holes
645
+ const laneMap = [];
646
+ for (let i = 0; i < TotalLanes; i++) {
647
+ laneMap.push(initial);
648
+ }
649
+ return laneMap;
650
651
652
export function markRootUpdated(
0 commit comments