HTML vs JSX

Hypertext Markup Language (HTML) is the standard language for documents that determine the structure of a web page.

HTML is a very important language in web development. Your code is either in HTML originally or compiles to it so browsers can read it.

JSX, on the other hand, means JavaScript Syntax Extension or JavaScript XML as some like to put it.

It was created as a syntactic sugar for React.createElement(). It is an extension of JavaScript that allows developers to write HTML right within JavaScript. So when you’re writing JSX, technically you’re writing JavaScript and HTML together.

Also, that means JavaScript’s reserved keywords must be kept intact. And that is why the “for” attribute in HTML is “HTMLFor” in JSX, since “for” is one of the commonest JavaScript reserved keywords.

In terms of support by browsers, HTML is supported by all of them. JSX, on the other hand, was never really intended to be, so you need a compiler like Babel or Webpack to transpile JSX into the JavaScript that browsers understand.

#html #jsx #javascript #react #web-development

HTML vs JSX – What's the Difference?
2.50 GEEK