DEV Community

Discussion on: Do you think the differences between HTML and XHTML are generally well-understood?

Collapse
 
ben profile image
Ben Halpern

React's JSX is XHTML-like. It's neither HTML or XHTML or JavaScript. It's its own thing, but I think people can get tripped up when their React linter tells them that <div></div> should be <div /> but then they don't fully understand that self-closing tags are not a thing in HTML otherwise. And it's a mistake that won't throw an error but could cause a big mess down the line.

Collapse
 
asaaki profile image
Christoph Grabo

I wish self-closing tags were a thing in HTML(5), because <div></div> and friends are sometimes unnecessarily noisier than <div />. Probably the only feature of XML I like anyway.
I still write a lot of my <meta />s that way, even if not needed, but I run it through tidy, so it makes the HTML the way browsers mostly expect it to be. :shrug: