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
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