Convert hyperscript attributes to properties
npm install hyperscript-attribute-to-property[travis-image]: https://img.shields.io/travis/feross/hyperscript-attribute-to-property/master.svg
[travis-url]: https://travis-ci.org/feross/hyperscript-attribute-to-property
[npm-image]: https://img.shields.io/npm/v/hyperscript-attribute-to-property.svg
[npm-url]: https://npmjs.org/package/hyperscript-attribute-to-property
[downloads-image]: https://img.shields.io/npm/dm/hyperscript-attribute-to-property.svg
[downloads-url]: https://npmjs.org/package/hyperscript-attribute-to-property
[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
[standard-url]: https://standardjs.com
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:
``js`
var vnode = h('div', { class: 'my-class' })
Instead of this:
`js`
var vnode = h('div', { className: 'my-class' })
Works with virtual-dom, react, hyperscript, or any DOM builder with a hyperscript-style API: h(tagName, attrs, children).
``
npm install hyperscript-attribute-to-property
`js``
var attrToProp = require('hyperscript-attribute-to-property')
var h = attrToProp(require('virtual-dom/h'))
If you use the hyperx package, then this functionality
is built-in and implemented via this package :)
MIT. Copyright (c) Feross Aboukhadijeh.