4 ms·
JSX is transpiled into Javascript (which generates HTML at runtime)- its function in React is basically that of a templating language. JSX also allows inlining
by kansface 12y ago
JSX 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.)