JSFiddle - React, Tailwind, and code Playground

HTML

<button type="button">
Click!
</button>

JavaScript

window.addEventListener("hashchange", function() {
	eventFunction();
}, false);

document.querySelector('button').addEventListener('click', function() {
	location.hash = "changed";
  otherFunction();
});

function eventFunction() {
	console.log('first');
}

function otherFunction() {
	console.log('second');
}