hyperscript-attribute-to-property

WebJar for hyperscript-attribute-to-property

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

hyperscript-attribute-to-property
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

hyperscript-attribute-to-property
WebJar for hyperscript-attribute-to-property
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/feross/hyperscript-attribute-to-property

Download hyperscript-attribute-to-property

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/hyperscript-attribute-to-property/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>hyperscript-attribute-to-property</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/hyperscript-attribute-to-property/
implementation 'org.webjars.npm:hyperscript-attribute-to-property:1.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/hyperscript-attribute-to-property/
implementation ("org.webjars.npm:hyperscript-attribute-to-property:1.0.0")
'org.webjars.npm:hyperscript-attribute-to-property:jar:1.0.0'
<dependency org="org.webjars.npm" name="hyperscript-attribute-to-property" rev="1.0.0">
  <artifact name="hyperscript-attribute-to-property" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='hyperscript-attribute-to-property', version='1.0.0')
)
libraryDependencies += "org.webjars.npm" % "hyperscript-attribute-to-property" % "1.0.0"
[org.webjars.npm/hyperscript-attribute-to-property "1.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

hyperscript-attribute-to-property travis npm downloads javascript style guide

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 = h('div', { class: 'my-class' })

Instead of this:

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).

install

npm install hyperscript-attribute-to-property

usage

example

var attrToProp = require('hyperscript-attribute-to-property')
var h = attrToProp(require('virtual-dom/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.

Versions

Version
1.0.0