News for hackers. Stuff that matters.
Re:Learning Node.js and React while building a product by ng12 on Tuesday June 13, 2017 @12:39PM (#14546123)
> just need to persuade myself to accept it mixed in JS file

Why is this a bad thing? The most important thing about JSX is that it's a single source of truth -- you never have to wonder if data is processed in the JS or in the template. I really think everything in one file is the ideal, we've even started moving the styles inline via styled-components.

Re:Learning Node.js and React while building a product by miroslavpopovic on Tuesday June 13, 2017 @04:03PM (#14548112)
Not a bad thing. Just a personal preference of trying to separate views and view models for a long time. I believe it just needs some time to get used to it. As I said, I really do like declarative nature of JSX, knowing that it's just compiled to a regular JS/DOM code.
Re:Learning Node.js and React while building a product by foota on Tuesday June 13, 2017 @05:02PM (#14548619)
Fwiw I think "compiled to" is a bit of a misnomer. From my understanding it's more like a DSL that gets interpreted by the renderer.
Re:Learning Node.js and React while building a product by ng12 on Tuesday June 13, 2017 @05:28PM (#14548814)
I think compilation is fair wording -- JSX is just sugar around the createElement API. : https://facebook.github.io/react/docs/react-api.html#createe...
Re:Learning Node.js and React while building a product by foota on Saturday June 17, 2017 @08:29AM (#14575607)
A bit late, but my thought is that compiled to js/Dom api to me implies that it's compiled directly to document.createElement and friends.