Skip to content

Instantly share code, notes, and snippets.

@Frodigo
Created October 26, 2021 18:16
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 Frodigo/4a52f5604fcdf66a1b64bf3b91714a28 to your computer and use it in GitHub Desktop.
Save Frodigo/4a52f5604fcdf66a1b64bf3b91714a28 to your computer and use it in GitHub Desktop.
JSX examples
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;
@Frodigo
Copy link
Author

Frodigo commented Oct 26, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment