4 ms·
My biggest issue with React is how it mixes HTML in Javascript. Like putting HTML inside strings or whatever they are doing. Without proper tooling and an edito
by qwertox 4y ago
My biggest issue with React is how it mixes HTML in Javascript. Like putting HTML inside strings or whatever they are doing. Without proper tooling and an editor which supports it, you won't get anywhere. At least that's my amateurish feeling on React, my reason for avoiding it. I may very well be wrong, but I wouldn't know.
- woah 4y ago> Like putting HTML inside strings or whatever they are doing. That's exactly what they're not doing
- cercatrova 4y agoYou'd be wrong. JSX is just syntax sugar over manipulating nested JS objects which represent the state. Try React sometime, their docs are great: https://beta.reactjs.org/ https://beta.reactjs.org/
- Ambroos 4y agoOf all the ways to write how your HTML is supposed to look from JavaScript, JSX is probably the closest to Javascript there is. It's a very simple syntax translation to JS function calls, and all code / logic is still plain JS. Every other template language that invents their own loops / conditionals / ways to insert variables is waaaaaaay further away from JS (and also still needs tooling and editor support).
- itslennysfault 4y ago... or don't write how your HTML is supposed to look from JavaScript. I like Angular's approach the best. You have an HTML file, a SCSS file, and a TS file. The TS file is essentially your model and handles all the thinking. HTML/SCSS are kept declarative like god intended.
- Ambroos 4y agoDo you genuinely think Angular's template language and all the complexity it comes with is better than JSX just saying "anything between {} is plain JS"?
- itslennysfault 4y agoAgreed. React reminds me of early days PHP. Which I supposed makes sense from an engineering org that was birthed on PHP. Separation of concerns?? NAHHH!!
- shepherdjerred 4y agohttps://vuejs.org/guide/scaling-up/sfc.html#what-about-separation-of-concerns https://vuejs.org/guide/scaling-up/sfc.html#what-about-separ...
- shepherdjerred 4y agoReact is not nesting HTML in JavaScript. React itself is just function calls. JSX makes the function calls look like HTML. HTML is generated from these function calls at runtime. Anyway, what editor are you using that doesn't support JSX? It has support for it in the major IDEs.