2 ms·
Yeah, all of the dynamic parts of JSX are Just Javascript. You can also look at JSX and know exactly how it will compile to Javascript because it's so simple.
by hombre_fatal 7y ago
Yeah, all of the dynamic parts of JSX are Just Javascript.
You can also look at JSX and know exactly how it will compile to Javascript because it's so simple. (foo && <Component {...props} />) -> (foo && React.createElement(Component, props)).
It really is just React.createElement calls. It just isn't a huge departure.
Meanwhile, what Elm compiles to is very nontrivial. The comparison only makes sense if you never actually looked at what JSX does thus mistake it for something much more complex.
Try it out yourself: https://babeljs.io/repl https://babeljs.io/repl