return [vnode, undefined]
}
const rawChildren = vnode.children as VNodeArrayChildren
+ const dynamicChildren = vnode.dynamicChildren as VNodeArrayChildren
const children = rawChildren.filter(child => {
return !(isVNode(child) && child.type === Comment)
})
}
const childRoot = children[0]
const index = rawChildren.indexOf(childRoot)
- const setRoot = (updatedRoot: VNode) => (rawChildren[index] = updatedRoot)
+ const dynamicIndex = dynamicChildren
+ ? dynamicChildren.indexOf(childRoot)
+ : null
+ const setRoot = (updatedRoot: VNode) => {
+ rawChildren[index] = updatedRoot
+ if (dynamicIndex !== null) dynamicChildren[dynamicIndex] = updatedRoot
+ }
return [normalizeVNode(childRoot), setRoot]
}