From 571119ddd2399f924cb54dc0e9b9f207be47e328 Mon Sep 17 00:00:00 2001 From: Meghea Iulian Date: Tue, 1 Mar 2022 08:45:45 +0200 Subject: [PATCH] fix: use hashchange event --- lib/use-hash-param.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/use-hash-param.js b/lib/use-hash-param.js index 013cc52..b9090f6 100644 --- a/lib/use-hash-param.js +++ b/lib/use-hash-param.js @@ -34,10 +34,10 @@ export const link = (hashParam, value) => { requestAnimationFrame(() => setParam(parameterized)); readParam(); window.addEventListener('popstate', readParam); - window.addEventListener('hash-changed', readParam); + window.addEventListener('hashchange', readParam); return () => { window.removeEventListener('popstate', readParam); - window.removeEventListener('hash-changed', readParam); + window.removeEventListener('hashchange', readParam); }; }, [parameterized]);