|
|
@@ -256,6 +256,7 @@ export const createFor = (
|
|
|
const previousKeyIndexMap = new Map(previousKeyIndexPairs)
|
|
|
const operations: (() => void)[] = []
|
|
|
|
|
|
+ let mountCounter = 0
|
|
|
const relocateOrMountBlock = (
|
|
|
blockIndex: number,
|
|
|
blockItem: ReturnType<typeof getItem>,
|
|
|
@@ -280,6 +281,7 @@ export const createFor = (
|
|
|
)
|
|
|
}
|
|
|
} else {
|
|
|
+ mountCounter++
|
|
|
operations.push(() =>
|
|
|
mount(
|
|
|
source,
|
|
|
@@ -310,7 +312,7 @@ export const createFor = (
|
|
|
relocateOrMountBlock(i, blockItem, blockKey, -1)
|
|
|
}
|
|
|
|
|
|
- const useFastRemove = operations.length === newLength
|
|
|
+ const useFastRemove = mountCounter === newLength
|
|
|
|
|
|
for (const leftoverIndex of previousKeyIndexMap.values()) {
|
|
|
unmount(
|