JSFiddle - React, Tailwind, and code Playground

by Qwerty_Wasd

JavaScript

function removeClass(element, class_rm) {
  element.className = element.className.replace(new RegExp('\\s' + class_rm + '\\s|\\s' + class_rm + '$|^' + class_rm + '\\s', 'gim'), ' ').trim();
}