Skip to content

Commit bbc7c40

Browse files
committed
Properly clear unmounted vnodes
1 parent 414fc5d commit bbc7c40

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

packages/core/src/runtime/unmount.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ options.unmount = vnode => {
77
if (typeof type === 'function' && vnodesForComponent.has(type)) {
88
const vnodes = vnodesForComponent.get(type);
99
if (vnodes) {
10-
const index = vnodes.indexOf(vnode);
11-
if (index !== -1) {
12-
vnodes.splice(index, 1);
13-
}
10+
const mountedVnodesForType = vnodes.filter(
11+
p => p.__c && p.__c !== vnode.__c
12+
);
13+
vnodesForComponent.set(vnode.type, mountedVnodesForType);
1414
}
1515
}
1616

0 commit comments

Comments
 (0)