4 ms·
Jsx never achieves plain-old-html in my view. <div /> is legal but <br> isn't.
by recursive 3y ago
Jsx never achieves plain-old-html in my view. <div /> is legal but <br> isn't.
- nicoburns 3y ago<br /> is which matches xhtml (if not html5)
- recursive 3y agoHtml 5 has displaced XHTML for decades. And notably, XHTML is not html. <br /> is valid html5, but the trailing slash is meaningless. In JSX, it's required.
- jraph 3y agoXHTML5 is a thing.
- recursive 3y agoThis is news to me. From what I can find (which is not much), it seems like XHTML5 is a further constraint on HTML5. So legal XHTML5 is legal HTML5. https://en.wikipedia.org/wiki/HTML5#XHTML_5_(XML-serialized_HTML_5) https://en.wikipedia.org/wiki/HTML5#XHTML_5_(XML-serialized_... If that's true, that means <div /> is not valid XHTML5 because 1) trailing slashes don't close tags in html and 2) div elements require a closing tag. And if that's true, then it's still different from JSX. But this XHTML5 thing might be surpassing my comprehension.
- jraph 3y ago> So legal XHTML5 is legal HTML5. Almost. You would need to make sure to write polyglot markup [1]. > And if that's true, then it's still different from JSX Absolutely. [1] https://www.w3.org/TR/html-polyglot/ https://www.w3.org/TR/html-polyglot/