|
|
|
|
|
by MBCook
2855 days ago
|
|
It’s JS, but not HTML. And most of the time you see it you’re making JSX elements, where you would expect to use the word ‘class’. I think they’re right it’s more consistent with what people would expect to happen. The fact there is a special note in the docs calling out that everyone gets it wrong is a sign it was a problematic choice. |
|
Similarly when you add a style to an element you don't get to use `background-color` for instance, it's `backgroundColor`. Yet they're not revisiting that decision, even though it's exactly the same, i.e. `background-color` can't be used to to a JS syntax conflict.
It seems arbitrary to make JSX attributes pertaining to a DOM that don't have a namespace match XML attributes in a markup language... while not at the same time doing the same to the CSS object model property names for instance.