Skip to content

v0.18.2 - Custom elements can have nested vtrees

Pre-release
Pre-release

Choose a tag to compare

@staltz staltz released this 02 Apr 19:42
· 3132 commits to master since this release

Implements #97. This is small yet nice addition to Custom elements. You can now provide children vtrees to a custom element as such:

h('my-element', [
  h('h3', 'Hello World')
])

You access these in the custom element's implementation like this:

Cycle.registerCustomElement('my-element', function (user, props) {
  var view = Cycle.createView(function (props) {
    return {
      vtree$: props.get('children$').map(children =>
        h('div.wrapper', children)
      )
    };
  });

  // ...
})

Check the example here.