4 ms·
Exactly this. Can someone explain to me what do people see in JSX way of creating components? What happened to good ol' code vs template separation and what's n
by M4v3R 11y ago
Exactly this. Can someone explain to me what do people see in JSX way of creating components? What happened to good ol' code vs template separation and what's now wrong with having two separate files - .html (or jade, or whatever) and .js?
- bicknergseng 11y agoWhat does code/template separation actually achieve? Ignoring JSX for a moment, why are templates a good thing? Are you actually simplifying something by using {{#each}} instead of .map()? Is {{#if}} really better than if()? Seems to me like templates don't actually decouple code.
- js-bs 11y agoReact supports testable dumb components, low-level dumb components like this Single Pixel component, https://github.com/js-bs/SinglePixel https://github.com/js-bs/SinglePixel , simply wouldn't be possible in regular html templating languages.
- bigpeopleareold 11y agoIn a large application, it starts to become a pain to deal with. It doesn't obviate the need to be careful over mixing responsibilities. In general, React components should just be things that render out to the DOM. If the HTML code is in JS, it doesn't matter as much as the more important thing of separating out your application layers.