JSX is just fancy HTML (With some rules) that compiles to pure JavaScript. So if you write something like this:
<div> <h1>Hello World</h1> </div>
It will compile to something like this:
React.createElement("div", null, React.createElement("h1", null, "Hello World"));
So now you can generate HTML with JavaScript. This is the basic idea behind JSX.
Great example! π
πWelldone
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
JSX is just fancy HTML (With some rules) that compiles to
pureJavaScript. So if you write something like this:It will compile to something like this:
So now you can generate HTML with JavaScript. This is the basic idea behind JSX.
Great example! π
πWelldone