https://custom-elements-everywhere.com/
You can see how React fares for itself.
Because that was their design choice: if you write attributes you pass them as attributes to the components
> I personally don’t understand why this hasn’t been fixed.
Because React is very popular and it's used everywhere in Facebook. You can't just change the behaviour without breaing a lot of stuff
> Preact has managed to support properties
> it would be fairly easy for React as well.
Yup, they should "just" do it. Meanwhile, here's an overview of what's needed for that support: https://github.com/facebook/react/issues/11347
Preact uses Option 2 in the list. Other libraries go for either Option 1 or Option 3. React is going with option 2 in an experimental branch.
https://javascript.info/dom-attributes-and-properties
In particular:
> So, if an attribute is non-standard, there won’t be a DOM-property for it. Is there a way to access such attributes?
> Sure. All attributes are accessible by using the following methods:
> elem.hasAttribute(name) – checks for existence.
> elem.getAttribute(name) – gets the value.
> elem.setAttribute(name, value) – sets the value.
> elem.removeAttribute(name) – removes the attribute.
> These methods operate exactly with what’s written in HTML.
Per Dan’s comment [1], they began rolling out the flag to test support at Meta in February and, barring any major problems, they’re still targeting 19.
0: https://github.com/facebook/react/issues/11347
1: https://github.com/facebook/react/issues/11347#issuecomment-...