Skip to content

Commit 6e994da

Browse files
committed
Not too sure why this works, or rather, why it doesn’t work without this rather strange approach. Unless I’m mistaken, the correct return value when `nodes.length < 2 && !nodes[0].text` is true should be `nodes[0]` rather than just `nodes` (as `nodes` is an array, not a VNode). However, returning just `nodes[0]` does not fix the bug where the portal contents don’t render as described in LinusBorg#20. Calling `createElement` on its constituent parts works, despite the output of the function and the initial `nodes[0]` VNode appearing identical upon inspection.
1 parent 21a0015 commit 6e994da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/TargetContainer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default Vue.extend({
1414
const nodes = this.updatedNodes && this.updatedNodes()
1515
if (!nodes) return h()
1616
return nodes.length < 2 && !nodes[0].text
17-
? nodes
17+
? h(nodes[0].tag, nodes[0].data, nodes[0].children)
1818
: h(this.tag || 'DIV', nodes)
1919
},
2020
destroyed() {

0 commit comments

Comments
 (0)