Why HTML Markup Cannot Be Directly Pasted into React
JSX is not HTML; it is an XML-like syntax extension for ECMAScript (JavaScript). Because JSX transpiles directly into React.createElement() or the modern JSX runtime jsx() function calls, attribute names must conform to valid JavaScript identifiers. Reserved keywords like "class" and "for" clash with JavaScript class declarations and for-loops, necessitating "className" and "htmlFor". Furthermore, JSX enforces strict XML syntax rules: all tags must be explicitly closed, and inline styles must be passed as JavaScript objects rather than raw CSS semicolon strings.