Skip to content

Instantly share code, notes, and snippets.

@alexkrolick
Last active September 30, 2017 21:49
Show Gist options
  • Save alexkrolick/badef85073fc39e711e14cf07782728f to your computer and use it in GitHub Desktop.
Save alexkrolick/badef85073fc39e711e14cf07782728f to your computer and use it in GitHub Desktop.
// JSX
<div className="myClass">
<Foo selected />
<Bar />
{ [1,2,3].map(i => i**2) }
</div>
// Equivalent createElement
h("div", { className: "myClass" },
h(Foo, { selected: true }),
h(Bar),
[1,2,3].map(i => i**2)
)
<div>
(whatever Foo does) (whatever Bar does) 1 4 9
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment