diff --git a/src/common/useLocationHash.js b/src/common/useLocationHash.js index 343b27e83..3079e57e1 100644 --- a/src/common/useLocationHash.js +++ b/src/common/useLocationHash.js @@ -3,12 +3,12 @@ const React = require('react'); const useLocationHash = () => { const [locationHash, setLocationHash] = React.useState(window.location.hash); React.useEffect(() => { - const onLocationHashChanged = () => { + const onLocationHashChange = () => { setLocationHash(window.location.hash); }; - window.addEventListener('hashchange', onLocationHashChanged); + window.addEventListener('hashchange', onLocationHashChange); return () => { - window.removeEventListener('hashchange', onLocationHashChanged); + window.removeEventListener('hashchange', onLocationHashChange); }; }, []); return locationHash; diff --git a/src/router/Router/Router.js b/src/router/Router/Router.js index a2a3a48fa..f020b3b00 100644 --- a/src/router/Router/Router.js +++ b/src/router/Router/Router.js @@ -29,7 +29,7 @@ const Router = ({ onPathNotMatch, ...props }) => { } }, []); React.useEffect(() => { - const onLocationHashChanged = () => { + const onLocationHashChange = () => { const { pathname, query } = UrlUtils.parse(window.location.hash.slice(1)); const routeConfig = routeConfigForPath(viewsConfig, pathname); if (!routeConfig) { @@ -72,10 +72,10 @@ const Router = ({ onPathNotMatch, ...props }) => { }); }); }; - window.addEventListener('hashchange', onLocationHashChanged); - onLocationHashChanged(); + window.addEventListener('hashchange', onLocationHashChange); + onLocationHashChange(); return () => { - window.removeEventListener('hashchange', onLocationHashChanged); + window.removeEventListener('hashchange', onLocationHashChange); }; }, [onPathNotMatch]); return (