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...
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.