hyperscript-attribute-to-property
Convert hyperscript attributes to properties
Some html attributes have different JavaScript property names. The most annoying of these
is class
v.s. className
.
With this package, you can do this:
var vnode =
Instead of this:
var vnode =
Works with virtual-dom, react, hyperscript, or any DOM builder with a hyperscript-style API: h(tagName, attrs, children)
.
install
npm install hyperscript-attribute-to-property
usage
example
var attrToProp = var h =
hyperx
If you use the hyperx package, then this functionality is built-in and implemented via this package :)
license
MIT. Copyright (c) Feross Aboukhadijeh.