preact-hyperscript icon indicating copy to clipboard operation
preact-hyperscript copied to clipboard

Classnames both as string (with tagname), and as "class" attribute

Open laggingreflex opened this issue 8 years ago • 2 comments

This doesn't work properly:

h('div.one', {class: {two: true}}, [...])`

It makes the class [object Object] one

laggingreflex avatar Feb 23 '17 23:02 laggingreflex

Implementing this would add a significant code overhead I think. You can take a stab at a PR if you want.

This should work just fine though:

h('div', { class: ['one', { two: true }] }, [...]

queckezz avatar Feb 24 '17 07:02 queckezz

@queckezz https://github.com/queckezz/parse-hyperscript/pull/1

laggingreflex avatar Feb 27 '17 03:02 laggingreflex