Duplicate node value `_class` and `attrs.class`?
See original GitHub issueThe class list is duplicated in every node, as _class
and attrs.class
. Is this intentional? If so, should we use attrs.class
when searching nodes for a match, since the use of a leading underscore implies “internal; don’t touch this”?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to copy all the attributes of one element and apply them ...
You can use the native Node#attributes property: http://jsfiddle.net/SDWHN/16/. var $select = $("select"); var $div = $("div"); var ...
Read more >API Reference - attrs 22.2.0 documentation
attrs works by decorating a class using attrs.define or attr.s and then optionally ... Sentinel to indicate the lack of a value when...
Read more >Node.cloneNode() - Web APIs - MDN Web Docs
The cloneNode() method of the Node interface returns a duplicate of the node on which this method was called. Its parameter controls if...
Read more >copy – Duplicate objects - Python Module of the Week
Shallow Copies¶. The shallow copy created by copy() is a new container populated with references to the contents of the original object.
Read more >How to Handle duplicate attributes in BeautifulSoup
Further, create a list to store all the item values of the same tag and attributes. Next, find all the items which have...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
you’re right. it happens during vnode creation, this won’t change.
_class is “private” because it’s an impl detail and only exists to support vnode.patch which must be aware of what classes were defined statically to be able to augment them. the final composed class string will always live in attrs.class and you can modify that as needed. _class should not be used.
Thanks. That’s what I needed to know.