JSFiddle - React, Tailwind, and code Playground

HTML

<div class="file">
    
</div>

CSS

.file {
    width: 30px;
    height: 30px;
    background: red;
}

JavaScript

$('.file').on('click', function(){
    $(this).css('background', 'blue');
});
                
$('.file').on('dblclick', function(event){
    event.preventDefault();
    $(this).css('background', 'green');                               
});