question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Duplicate node value `_class` and `attrs.class`?

See original GitHub issue

The 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:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
leeoniyacommented, Mar 22, 2017

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.

0reactions
lawrence-dolcommented, Mar 22, 2017

Thanks. That’s what I needed to know.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found