-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Description
Snabbdom uses a hyper-script-like function to build it's vdoms, but it's second argument is different. Instead of attributes it's properties are used by various "modules";
h('div', {
props: {title: someString}, // snabbdom/modules/props
classes: {selected: isSelected}, // snabbdom/modules/class
on: {click: doSomething}, // snabbdom/modules/eventlisteners
style: {color: someColor} // snabbdom/modules/style
}, ['children'])
The snabbdom-jsx module handles this using prefixed attributes in JSX:
<div
title={someString}
class-selected={isSelected}
on-click={doSomething}
style: {({color: someColor})}
>
children
</div>
Would it be feasible for hyperx to do this as well?
sartaj, jamen and rebolyte
Metadata
Metadata
Assignees
Labels
No labels