mithril.js: vnode.dom in component with array at the top level returns the first child

Expected: vnode.dom would return a NodeList or an Array

Actual:

var component = {
     oncreate: function(vnode){
          console.log(vnode.dom)
     },
     view: function(){
          return [
               m('.first'),
               m('.second')
          ]
     }
}

This example logs out <div class="first"></div>

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 5
  • Comments: 21 (20 by maintainers)

Most upvoted comments

Well a change to what vnode.dom is would be breaking behaviour for anyone using dom.nextElementSibling (like I am…)