Created
October 8, 2019 19:15
-
-
Save mikaelbr/a0c78975f8e0aafbc7046b406f9dcc78 to your computer and use it in GitHub Desktop.
Code for blogpost "Using JSX for your own lightweight declarative library": https://medium.com/@mikaelbrevik/using-jsx-for-your-own-lightweight-declarative-library-a773d3796475
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
const list = ( | |
<ul> | |
<li>Peter</li> | |
<li>Paul</li> | |
<li>Mary</li> | |
</ul> | |
); | |
// Outputs | |
const list = React.createElement( | |
"ul", | |
null, | |
React.createElement("li", null, "Peter"), | |
React.createElement("li", null, "Paul"), | |
React.createElement("li", null, "Mary") | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment