Created
March 22, 2016 16:56
-
-
Save jjt/780b6044fc6610014311 to your computer and use it in GitHub Desktop.
React Hyperscript vs JSX
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
h('div.example', [ | |
h('h1#heading', 'This is hyperscript'), | |
h('h2', 'creating React.js markup'), | |
h(AnotherComponent, {foo: 'bar'}, [ | |
h('li', [ | |
h('a', {href: 'http://whatever.com'}, 'One list item') | |
]), | |
h('li', 'Another list item') | |
]) | |
]) | |
<div className="example"> | |
<h1 id="heading">This is JSX</h1> | |
<h2>creating React.js markup</h2> | |
<AnotherComponent foo={bar}> | |
<li><a href="http://whatever.com">One list item</a></li> | |
<li>Another list item</li> | |
</AnotherComponent> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment