6 ms·
React is far from vanilla HTML. It uses JSX with attributes e.g. `className` or `htmlFor` instead of HTML's `class` or `for`. And JSX requires compiling to HTML
by niutech 3y ago
React is far from vanilla HTML. It uses JSX with attributes e.g. `className` or `htmlFor` instead of HTML's `class` or `for`. And JSX requires compiling to HTML rather than being HTML from the beginning.
- Kiro 3y agoBoth className and htmlFor are native. https://developer.mozilla.org/en-US/docs/Web/API/Element/className https://developer.mozilla.org/en-US/docs/Web/API/Element/cla... https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/htmlFor https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelEl...
- arcanemachiner 3y agoWoah.
- niutech 3y agoYes, but it's JS, it isn't vanilla HTML.
- MrJohz 3y agoIt's almost identical to vanilla DOM, though, which does use className and htmlFor. I'm not sure that the compilation aspect is relevant - pretty much all modern frameworks using a template language have a compilation step. ngFor doesn't exist in the browser after all! ;)
- martinsnow 3y agoYou're confusing the XHTML/HTML and JavaScript API naming schemes
- sixbrx 3y agoI'd say it's JSX doing that because those attributes are clearly on the declarative/markup side of the divide, not the procedural/imperative dom manipulation side.