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.

Support for classList

See original GitHub issue

Do you want to request a feature or report a bug?

feature

What is the current behavior?

Only className exists right now.

What is the expected behavior?

I think adding classList property for DOM elements would be useful. As far as I understand React Fire will drop support for IE11 but even in IE11, you can add or remove classList from elements.

Another idea might be adding support for for array type for className (or future class, which will make more sense because array). If array is passed, classList will be used for DOM elements. Otherwise, className is used as usual in the real DOM side.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

All versions. I hope this is added in React Fire.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
GeKormcommented, Oct 11, 2018

Unless I’m misunderstanding, I think this is already handled perfectly by classnames (docs link) or classcat.

0reactions
gaearoncommented, Nov 1, 2018

Please submit an RFC for how it should work. It’s not obvious to me what the design is when you mix classList with className, and what components that pass names through (but add extra ones) should do.

https://github.com/reactjs/rfcs

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

"classList" | Can I use... Support tables for HTML5, CSS3, etc
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >
Element.classList - Web APIs | MDN
The Element.classList is a read-only property that returns a live DOMTokenList collection of the class attributes of the element.
Read more >
Support & Updates - Classlist
Whether you've forgotten your password or need some help with setting up a school, we're here to help. Check out the Classlist Helpdesk...
Read more >
HTML DOM Element classList Property - W3Schools
The classList property returns the CSS classnames of an element. ... supports(), Returns true if a token is one of an attribute's supported...
Read more >
The .classList() API - CSS-Tricks
This browser support data is from Caniuse, which has more detail. A number indicates that browser supports the feature at that version and...
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