render(renderFn(['two', 'one']), root)
expect(serializeInner(root)).toBe(`text<div>two</div>text<div>one</div>`)
})
+
+ // #10007
+ test('empty fragment', () => {
+ const root = nodeOps.createElement('div')
+
+ const renderFn = () => {
+ return openBlock(true), createBlock(Fragment, null)
+ }
+
+ render(renderFn(), root)
+ expect(serializeInner(root)).toBe('')
+ })
})
// since they are either generated by the compiler, or implicitly created
// from arrays.
mountChildren(
- n2.children as VNodeArrayChildren,
+ // #10007
+ // such fragment like `<></>` will be compiled into
+ // a fragment which doesn't have a children.
+ // In this case fallback to an empty array
+ (n2.children || []) as VNodeArrayChildren,
container,
fragmentEndAnchor,
parentComponent,