3 ms·
How many of you developers who use React and say that JSX is the second coming of Jesus, are also able to produce a semantically coherent HTML document with JSX
by trumbitta2 10y ago
How many of you developers who use React and say that JSX is the second coming of Jesus, are also able to produce a semantically coherent HTML document with JSX?
It seems to me that React + JSX are perfect for "divitists" and devs who use a h3 because its font-size has the desired value.
I'm not being sarcastic, I genuinely can't understand why a good web developer who cares about the meaning of a HTML document should like JSX.
- tomelders 10y agoWell there's nothing stopping you using the right element for the job. But I would argue that the semantics of HTML, whilst useful in a publication paradigm, don't translate as easily to a web application, which is where React shines. I'd also argue that React is not a good fit for something like a blog, or a news site.
- lllr_finger 10y agoThis is a great point, and a sword I fell on at my previous employer. React is great for stateful web apps - a blog or a news site have some state, but aren't really that state heavy. Especially when you have a news site getting millions of views, you simply can't afford 1 second on page load to download, parse, and eval React and your data model for little gain. I've seen devs that are so infatuated with React and "isomorphism" that they will use it as a hammer for every screw they come across.
- lllr_finger 10y agoI wouldn't argue that it's the second coming of Jesus, but it's been pleasant to work in. React creates HTML from JavaScript, and JSX is a convenient, intuitive, and familiar way to express your code. I've found that React generates trustworthy HTML, letting me focus on business logic and the interesting parts of development. I've never come across a scenario where React threatened the coherency of my code (other than the data attributes that are now optional, thankfully).
- BigJono 10y agoI must be completely missing your point. React supports the vast majority of html elements. There's nothing I can think of about React that would encourage someone to misuse html, you're using the exact same tags you'd be using to create a vanilla site. The only difference is that you're declaratively defining how they change based on state. A good html developer will still use best practices when using React, a bad one won't. What's the difference?
- trumbitta2 10y agoI don't know, I have yet to stumble upon a React developer who doesn't just use divs and spans for everything and who doesn't choose headings because of their font size. That's why this question began to slowly form in my mind. [edit: phrasing and grammar]