5 ms·
more "standard" compared to jsx for sure. To me, jsx feels like an ugly hack.
by makkesk8 7y ago
more "standard" compared to jsx for sure.
To me, jsx feels like an ugly hack.
- xmprt 7y agoI don't know much about JSX internals but to me it feels a lot closer to HTML than Vue templates do. It feels a lot more natural to create multiple elements by mapping a list than it is to use v-for
- robertoandred 7y agoAnd Vue's weird, non-standard quasi-template attributes don't?
- ysavir 7y agoNot at all. Vue's templating (and angular's) is essentially extended HTML--you're writing HTML _as HTML_, using HTML's native practices (element attributes) to hook into the JS. I disliked this when I first used Angular, but after adjusting to it I've found that it's highly respectful of HTML's design patterns, the opposite of a hack.
- makkesk8 7y agoThey're not really a hack since javascript does support custom attributes. Jsx is not supported out of the box by javascript and jsx extends the syntax, so what does actually feel more of a hack? ```const element = <h1>Hello, world!</h1>;``` How is this less of a hack compared to vue's attributes?
- dimgl 7y agoNeither Vue's template syntax nor React's JSX look like standard HTML. So I'm not sure what you're talking about.
- derision 7y agoOther than curly braces and some custom attributes how does Vue not look like HTML?