Created
October 26, 2021 18:16
-
-
Save Frodigo/4a52f5604fcdf66a1b64bf3b91714a28 to your computer and use it in GitHub Desktop.
JSX examples
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
export const App = () => { | |
return ( | |
<main id="root"> | |
<h1>Hello Folks!</h1> | |
<p> | |
Random question: | |
Is <strong>FC Barcelona</strong> win any match in the Champions League this season? | |
</p> | |
</main> | |
); | |
} | |
export default App; | |
// jsx code above will be compiled to the regular JavaScript: | |
export const App = () => { | |
return React.createElement( | |
"main", | |
{ id: "root" }, | |
React.createElement( | |
"h1", | |
null, | |
"Hello Folks!" | |
), | |
React.createElement( | |
"p", | |
null, | |
"Random question: Is ", | |
React.createElement( | |
"strong", | |
null, | |
"FC Barcelona" | |
), | |
" win any match in the Champions League this season?" | |
) | |
); | |
}; | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Read more: https://marcin-kwiatkowski.com/blog/what-is-jsx-and-is-it-worth-making-friends-with-it