JSFiddle - React, Tailwind, and code Playground
by brigand
JavaScript
let cls = useState(() => new MyClass('test'));
const onClsClick = (e) => {
//some on click code, related to the CLS class
//need to use cls here on this event
}
useEffect(() => {
cls = new myClass('test');
cls.start();
}, []);