> 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:
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.
do {
if (condition) <div>yes</div>
else <h>nope</h>
}
Though most would probably prefer the following for stylistic reasons:
condition
? <div>yes</div>
: <h>nope</h>
> because those subtle differences can cost you hours of looking for mistakes
These two things are explained in a single sentence, every tutorial eases you into it, the first thing that comes up once JSX is mentioned.