Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Raynos/ea4c2f493c33143bea00 to your computer and use it in GitHub Desktop.
Save Raynos/ea4c2f493c33143bea00 to your computer and use it in GitHub Desktop.
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