https://babeljs.io/repl/#?experimental=true&evaluate=true&lo...
I felt the same as OP when I first started using React, although it makes more sense now I've played with it, I'm still not sure about mixing concerns (code and view) in the same file. Especially when you start talking about CSS too...
JSX is a JavaScript syntax extension that looks similar to XML.
Don't we all hate XML? How can you possibly even go on reading about this technology further if it's introduced like that.I believe people hating XML has more to do with using XML as a data transfer format, right? I'm happy using XML for Android layouts but can't imagine using it as a replacement for JSON - which I think is where most of the hate comes from.
But if you're using XML to basically make a variant of HTML, it's great.
JSX is a JavaScript syntax extension that looks similar to HTML.It's not a text templating language like classic PHP, it's an object/function calls hierarchy DSL (more like vb.net XML literals). I think most people critisizing react for putting html in JS havn't tried it or don't remember why "html" in code was considered bad in the first place.
I'm also thinking in more of an Angular2 context as that's what I'm most familiar with.
https://facebook.github.io/react/docs/jsx-in-depth.html
[NB Not that I know, just checking my own understanding].