DEV Community

Visakh Vijayan
Visakh Vijayan

Posted on

What is the big deal with JSX

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)