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.
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:
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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.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: