#910·history

v5 hash history not longer emits hashchange event

Author: markdotenCreated Dec 6, 2021Updated Mar 13, 2023

Listening on the window for the hashchange no longer works in V5 though it worked in V4.

I'm using Chrome v96.

Reproduce:

javascript
import { createHashHistory } from "history";
const history = createHashHistory();
window.addEventListener('hashchange', () => console.log('HASH CHANGED'));
history.push("/test");

Nothing is printed to the console.

Can be seen here: https://codesandbox.io/s/fervent-keldysh-n9g56?file=/src/index.js