JSFiddle - React, Tailwind, and code Playground

HTML

<button class="arrowRight">Button</button>

CSS

.disable { 
       cursor: default;
}

JavaScript

var clickCount = 0;

$(".arrowRight").click(function () {
    clickCount++;

    if (clickCount >= 3) {
        clickCount = 0;
        $(".arrowRight").removeClass("active");
        $(".arrowRight").addClass("disable");
    }
    else { 
        $(".arrowRight").removeClass("disable"); // this is the line that isnt working
        $(".arrowRight").addClass("active"); // but this works
    }
});