4 ms·
Interesting article. I had built the right intuitions empirically (except for frameworks, which I don't practice much) but it's nice to read it. > The funny th
by jraph 3y ago
Interesting article. I had built the right intuitions empirically (except for frameworks, which I don't practice much) but it's nice to read it.
> The funny thing is, React popularised using className instead of class in what looks like an attribute. But, even though you're using the property name rather than the attribute name, React will set the class attribute under the hood.
Yeah, I never understood why they did this. className in their XML-like syntax is ugly and it doesn't seem like they needed to do this. They could have gone with class. They are parsing this with their custom JSX parser, and these things are not JS identifiers. IIRC you need to use {accolades} to put JS expressions (objects) there.