JSFiddle - React, Tailwind, and code Playground
HTML
<div></div>
JavaScript
$("div").on("test.1", function() {
console.log(1)
}).on( "test.2", function() {
console.log(2)
}).trigger("test")
<div></div>
$("div").on("test.1", function() {
console.log(1)
}).on( "test.2", function() {
console.log(2)
}).trigger("test")