Skip to content

Instantly share code, notes, and snippets.

@parshap
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save parshap/87997ec11e90c33296bf to your computer and use it in GitHub Desktop.
Save parshap/87997ec11e90c33296bf to your computer and use it in GitHub Desktop.
virtual-hyperscript children as props.children
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