Re:What should go into JSX 2.0?
by substack on Sunday October 16, 2016 @12:45PM
(#12719484)
Also keep in mind that javascript engines have a built-in mechanism for including multi-line strings with a powerful substitution engine: tagged template strings (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...). The upside of template strings is that you can run your code directly in node or electron without using extra tooling first. It is possible and not hard to use tagged templates with react, although few people do. It's more common in some other frontend ecosystems.
[ Parent
| on HN ]
JSX isn't templating. It's representing a virtual dom tree of function calls with a syntax more representative of the resulting markup.
You can build virtual dom trees or use real dom nodes using something like https://www.npmjs.com/package/morphdom . Tagged template strings let you build these features in without custom language extensions. See also:
* https://www.npmjs.com/package/hyperx * https://www.npmjs.com/package/yo-yo