4 ms·
>I was playing with the idea of using JS objects as a template engine: http://m1el.github.io/jsonht.htm http://m1el.github.io/jsonht.htm, and I'm pretty happy w
by coldtea 11y ago
>I was playing with the idea of using JS objects as a template engine: http://m1el.github.io/jsonht.htm http://m1el.github.io/jsonht.htm, and I'm pretty happy with it.
Isn't that the same as (among several other things) React's JSX?
- abritinthebay 11y agoIt's pretty much identical. I don't think people realize that all JSX is, is a way to elegantly write out something that transpiles down to a pure object representation of the DOM. JSX and React have a few quirks where React means it's not quite a pure object, but the React devs are working on removing those.
- deleted 11y ago[deleted]
- m1el 11y agoYes, it is. If you replace Array literals with `React.createElement`, you will (almost) get compiled JSX templates.