JSFiddle - React, Tailwind, and code Playground
HTML
<div id="element">click</div>
JavaScript
var data = {
test: 'test'
};
$('#element').on('click', data, function (e) {
console.log(e.data)
});
data = {
test: 'foo' // doesn't matter, the data in the event handler will not change
};