DEV Community

loading...

What is the big deal with JSX

Visakh Vijayan
Willing to learn anything and everything exciting. Always awake. Skips food for fun.
・1 min read

JSX stands for JavaScript XML. This is actually not a part of the core language but rather a syntax-extension.

You see, normal React is pretty hard to write. For instance, if you want to create an h1 element using core React code it will be something like this -

var template = React.createElement(
  "h1",
  null,
  "Hello World"
);

Enter fullscreen mode Exit fullscreen mode

However, JSX makes it simple to write it by doing so -

var template = <h1>Hello World</h1>

Enter fullscreen mode Exit fullscreen mode

Pretty Cool isn't it. JSX allows you to write plain HTML into JavaScript and believe me when I am saying it makes life so much simpler.

Next: Tools to use

Discussion (0)