JSFiddle - React, Tailwind, and code Playground

by brigand

JavaScript

let ref = useRef();

    const onClsClick = (e) => {
      // use ref.current here
    }

    useEffect(() => {
      ref.current = new MyClass('test');
      ref.current.start();
    }, []);