Closed caub closed 8 years ago
Hi, what are your sights on the syntax:
h('html', [ h('head', [ h('title', 'Server side rendering') ]), h('body', [ content, h('script', JSONGlobals({ state: state })), h('script', { src: 'bundle.js' }) ]) ]); // vs h('html').add( h('head').add( h('title').text('Server side rendering') ), h('body').add( content, h('script').add(JSONGlobals({ state: state })), h('script').attr({ src: 'bundle.js' }) ) );
personally I prefer the second, even if slightly more verbose it's a bit more clear, .text is a shortcut for .attr({text..: ..})
var tree = h('div.foo#some-id', [ h('span', 'some text'), h('input', { type: 'text', value: 'foo' }) ]);
would be
var tree = h('div.foo#some-id').add( h('span').text('some text'), h('input').attr({ type: 'text', value: 'foo' }) );
@Raynos (sorry to ping you:), would appreciate your input)
Isn't this really more of a hyperscript question?
sorry I realized it too, will move it there, thanks
https://github.com/Matt-Esch/virtual-dom/issues/364
Hi, what are your sights on the syntax:
personally I prefer the second, even if slightly more verbose it's a bit more clear, .text is a shortcut for .attr({text..: ..})
would be
@Raynos (sorry to ping you:), would appreciate your input)