Our attribute vs property resolution algorithm should be documented #2345
Labels
Area: Documentation
For anything dealing mainly with the documentation itself
Type: Bug
For bugs and any other unexpected breakage
Currently, there's no mention in the relevant documentation about how we tell attributes and properties apart. It's pretty simple to explain: if
prop in vnode.dom
, it's treated as a property, and if not, it's treated as an attribute. This is a pretty simple thing to add, and it could probably be done within an hour if that.We do need to mention that in the case of ill-behaved custom elements where identically-named properties and attributes exist, you should use
oncreate
/onupdate
to update it if Mithril does the wrong thing (like if you need to update the attribute and not the property)./cc @barneycarroll @porsager
The text was updated successfully, but these errors were encountered: