HACKER Q&A
📣 osdevisnot

Why can't JSX be added to the language?


JSX is such a nice abstraction to work with. Why why why why why why why why why can't we make it part of the language


  👤 acemarke Accepted Answer ✓
Funny you should ask that. Someone asked that exact question in Reactiflux a couple days ago. This was my response:

> Many reasons. For one, anything that the browser supports now, it has to support... forever. For another, all browsers up until now don't support JSX syntax, so you'd still have to compile your code to handle all existing browsers.

> Also, the JSX syntax is not React-specific. Typical usage is to compile `` to `React.createElement(MyComponent)`, but you can edit your build settings to compile it to other similar APIs for other frameworks.

> The JSX syntax has been pretty stable for a while, but there's been plenty of proposals to tweak it further. How would that get handled?


👤 duskwuff
Mozilla actually had something similar to JSX at one point:

https://developer.mozilla.org/en-US/docs/Archive/Web/E4X