JSX stands for Javascript XML. React works without using JSX but it is advised to use it to write more elegant code. Let us find out what JSX is and the pros of using it: What is JSX? JSX is syntactic sugar to React.createElement(component, props, ...children) function. In short it basically allows you to write HTML in react code. Why JSX? React embraces the fact that rendering logic is inherently coupled with other UI logic like handling events, how data is prepared for display e.t.c.. so instead of separating markup and logic into different files. It is easier to have it along side your ReactJS code. Also, it's type-safe which helps you to catch most of the errors during compilation. JSX and it's React code: JSX const element = ( <h1 className="greeting" > Hello, React! </h1> ); Above JSX will get compiled to the following code without JSX: var element = React.createElement( "h1", { className: ...
Scribble-pad of a humble, hungry and foolish engineer. "Stay Hungry, Stay Foolish" -Steve Jobs