Created
January 17, 2016 03:38
-
-
Save colingourlay/689186ba58b5cf1e9e4d to your computer and use it in GitHub Desktop.
Using virtual-hypercript + hyperstyles + hyperx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var vdom = require('virtual-dom'); | |
var hyperx = require('hyperx'); | |
var hyperstyles = require('hyperstyles'); | |
var styles = { /* Mock CSS Module */ | |
'root': 'Car__root___fg434', | |
'front-door': 'Car__front-door___b85f9', | |
'back-door': 'Car__back-door___p9h7j' | |
}; | |
var hx = hyperx(hyperstyles(vdom.h, styles)); | |
function render() { | |
return hx`<div styleName="root"> | |
<div styleName="front-door"></div> | |
<div styleName="back-door"></div> | |
</div>`; | |
} | |
console.log(vdom.create(render())); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment