| IMO JSX is such a simple syntactic sugar around javascript that you can unfold it in your head. > <element someProp={prop} /> = React.createElement('elment', {someProp: prop}, null) Its such a simple transformation and adheres to javascript standard behavior. JSX doesn't add anything new, it just adds a way to do something old. Its a shortcut to 1 transformation and thats it. You can unpack it in your head. So while I agree with you that it isn't "standard javascript", if you look past the visual differences, there is no difference between JSX and javascript. This is in stark contrast to the Vue.js (and other) template systems which, while they compile to javascript, the amount of transformations makes it impossible to extend the template system easily without touching the internals of the template engine. JSX is just syntax, other template systems are entire secondary languages. |
I don't understand your point, to be honest. A lot of language features are just syntactic sugar for lower-level language functionality. ES6 getter/setters are just syntactic sugar for Object.defineProperty. Does this mean that ES6 and ES5 are the "same"?
No, of course not, but ES6 getter/setters are specified in ECMA-262 and JSX is not, so ES6 gets to be called JavaScript and JSX doesn't. It's really as simple as that.
My point is that because JSX is not JavaScript it then requires a ton of complexity to use it. Whether that complexity is justified is up to each person, but we can't ignore that complexity exists when arguing it vs. alternatives.