> If it was just html I could write <label for=""> and not <label htmlFor="">, I could write <div class=""> instead of <div className="">
for and class are reserved statements, hence htmlFor and className are the official api names, in other words they belong to the actual web-api spec, there's nothing arbitrary about it:
Some react-like libs do allow it, but the dom api takes offcial precedence, so it's all fine. It's just that HTML in general was made without taking all the things into account we demand of it today. It wasn't even made for imperative inflating, so the dom-api faced the same troubles.
for and class are reserved statements, hence htmlFor and className are the official api names, in other words they belong to the actual web-api spec, there's nothing arbitrary about it:
https://developer.mozilla.org/en-US/docs/Web/API/Element/cla...
https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelEl...
If you really dislike it, you can still use class and for: https://github.com/insin/babel-plugin-react-html-attrs
> or I would be able to write a simple if-else statement
{} evaluates to a ternary. You can use if, according to the spec that's what do expressions are there for.
Though most would probably prefer the following for stylistic reasons: > because those subtle differences can cost you hours of looking for mistakesThese two things are explained in a single sentence, every tutorial eases you into it, the first thing that comes up once JSX is mentioned.