How to convert JSX into Javascript?

How to use JSX in React.js? »

Babel is the library that helps it convert to Javascript code. You can learn a bit more about Babel here.I’m sure you want to see how the converted code looks like, right? You can check that for yourself using one of the below links. There, you just have to paste your JSX code and it’ll convert to equivalent Javascript for you.

https://babeljs.io/repl/

https://reactjs.org/jsx-compiler.html/

For example, if you paste the below code:

const App = () => {
return <div>Hello World!</div>;
}

It’s equivalent Javascript code will be:

"use strict";

var App = function App() {
return React.createElement("div", null, "Hello World!");
};

This is the code that your browser can understand easily. In the above code, we’re creating a Javascript element named div, having value “Hello World”. Now you may question that if we can write Javascript code directly, then what’s the point of writing in JSX?