Swizz / snabbdom-pragma

'NotReact.createElement' jsx pragma although for snabbdom
MIT License
47 stars 16 forks source link

Is `h('div#id.class1.class2', ...)` needed ? #8

Open Swizz opened 7 years ago

Swizz commented 7 years ago

ATM, the sel property in Snabbdom-pragma is only related to the html element.

Snabbdom-JSX use something like the following code, to handle something they call Id and static classes (sel attribute)

<div selector="#id.class1.class2" />

Today, you can use the following code to achieve this

<div id="id" class={{ 'class1': true, 'class2': true }} />

So, Is this feature requested ?

Swizz commented 7 years ago

The following code is also working as intended

 <div id="id" attrs-class="class1 class2" />

We can also aim to use

 <div id="id" class={['class1', 'class2']} />
Swizz commented 7 years ago

https://github.com/JedWatson/classnames