hyperhype / hyperscript

Create HyperText with JavaScript.
MIT License
2.64k stars 110 forks source link

Hope this one can be mentioned at readme #67

Open lili21 opened 7 years ago

lili21 commented 7 years ago
h('div#menu', { style: { 'background-color': '#2f2', 'opacity': 1 } })

This won't work, style property's value must be string.

senko commented 7 years ago

I recently updated from hyperscript 1.4.6 to 2.0.2 and hit this same problem. Looking at the relevant commits, it seems that the change that introduced this was: https://github.com/hyperhype/hyperscript/commit/c1f03e057ec8cfc26b9ec9c801942a3355217dee

It looks to me like this is a bug and not indended behaviour. In that case, @dominictarr would you accept a PR that fixes this? The fix is easy, don't use match if the value is not a string, and would be happy to provide it with accompanying test.

dominictarr commented 7 years ago

@senko yes please!