<self-closing />
tag are not allowed in HTML custom element.
Why is that?
Many cases just need void tag, I guess by that, code would be more readable. On the other hand, it implies semantic meaning more directly.
Just like <hr />
, which by code itself means there shouldn't be any children inside it, because there's no place for that.
Plus it has nothing to do with children.
Custom elements cannot be self-closing because HTML only allows a few elements to be self-closing. (read more)