What is JSX?
JavaScript XML(JSX) is the extension of JavaScript language to write XML like code in JavaScript.
Why do we need it?
React recommends using JSX to create React elements as it is developer-friendly, and behind the scenes, it will be transpiled to React JavaScript code by Babel.
Eg:
JSX Code
<h1 id="test">Hello World</h1>
Transpiled code:
React.createElement("h1",{id:"test"},"Hello World");
Comments
Loading...
Leave a reply