MCPcopy Create free account
hub / github.com/flyfloor/react-component / _removeClass

Function _removeClass

component/util/dom.js:25–39  ·  view source on GitHub ↗
(el, className)

Source from the content-addressed store, hash-verified

23}
24
25function _removeClass(el, className){
26 const clist = getClassList(el);
27 const length = clist.length;
28 let str = '', changed = false;
29 for (let i = 0; i < length; i++) {
30 if (!clist[i]) continue;
31 if (clist[i] === className) {
32 changed = true;
33 } else {
34 if (str) str += ' ';
35 str += clist[i];
36 }
37 }
38 if (changed) el.className = str;
39}
40
41export function hasClass(el, className){
42 if (el && className && el instanceof Node) {

Callers 1

removeClassFunction · 0.70

Calls 1

getClassListFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…