3 ms·
This has the downside of mixing properties/attrributes with children. So, in `div`, `class` is a property, but `input` that immediately follows is a child of t
by troupo 3y ago
This has the downside of mixing properties/attrributes with children.
So, in `div`, `class` is a property, but `input` that immediately follows is a child of the component
- djur 3y agoIronically, this is a case where one of Lua's most controversial features comes in handy. Tables can be initialized with both named and sequential members. In this case, "class" is a named member and the `input` element is sequential.
- wruza 3y agoI think gp meant that they can be reordered in a way that is hard to reason about, e.g. {…many-children…, class=""}, putting attributes away from a tag.
- troupo 3y agoYup. That's what I'm thinking about. It's a similar issue as CSS nesting, by the way :) I'm not saying it's inherently bad, it's just it could be confusing. But could probably solved by a linter: put attributes at the top, nested children at the bottom