Forked from parshap/virtual-hyperscript-children.js
Last active
August 29, 2015 14:13
-
-
Save Raynos/ea4c2f493c33143bea00 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 h = require("virtual-hyperscript"); | |
// Children as arguments[2] | |
h("div", { | |
"aria-hidden": true, | |
"ev-click": onClick, | |
}, [ | |
h("p", { | |
"aria-hidden": true, | |
"ev-click": onClick, | |
}, [ | |
"Some hidden ", | |
h("strong", "and strong"), | |
" text.", | |
]), | |
h("textarea", { | |
"ev-change": onChange, | |
}, [ | |
"Some children ", | |
"for the textarea", | |
]), | |
]) | |
// Children as props.children | |
h("div", { | |
"aria-hidden": true, | |
"ev-click": onClick, | |
children: [ | |
h("p", { | |
"aria-hidden": true, | |
"ev-click": onClick, | |
children: [ | |
"Some hidden ", | |
h("strong", "and strong"), | |
" text.", | |
], | |
}), | |
h("textarea", { | |
"ev-change": onChange, | |
children: [ | |
"Some children ", | |
"for the textarea", | |
], | |
}), | |
] | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment