v0.18.2 - Custom elements can have nested vtrees
Pre-release
Pre-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.