3 ms·
Somebody please enlighten me as to why this is better than good ol' JSON or XML/SGML/HTML, especially if it's meant to be processed into something else anyway?
by kijin 12y ago
Somebody please enlighten me as to why this is better than good ol' JSON or XML/SGML/HTML, especially if it's meant to be processed into something else anyway?
- kansface 12y agoJSX is transpiled into Javascript (which generates HTML at runtime)- its function in React is basically that of a templating language. JSX also allows inlining Javascript in a limited fashion. I could not imagine a sane implementation using JSON. As for XML and friends, you would have to shoehorn in supporting JS.
- kijin 12y agoThanks, I'd been genuinely curious. (I tend to stay as far away as I can from JS-based templating systems, so that's probably why I didn't appreciate that use case.)