JSFiddle - React, Tailwind, and code Playground

JavaScript

var test = function(){
  console.log('click');
};

$(document).on('click.name', test.bind(this));
$(document).off('click.name');