JSFiddle - React, Tailwind, and code Playground
HTML
<a href="?tx">click</a>
JavaScript
document.querySelector('a').addEventListener('click', function (e) {
e.preventDefault();
history.pushState(null, null, '?tx');
});
window.addEventListener('popstate', function () {
console.log('hey');
});