From 718660d117c0a765d5a7e977e522acec4cd795ac Mon Sep 17 00:00:00 2001 From: NikolaBorislavovHristov Date: Mon, 22 Apr 2019 16:36:31 +0300 Subject: [PATCH] minor func renaming in Router --- src/navigation/Router/Router.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/navigation/Router/Router.js b/src/navigation/Router/Router.js index 22abddf8a..8cde0f27f 100644 --- a/src/navigation/Router/Router.js +++ b/src/navigation/Router/Router.js @@ -31,7 +31,7 @@ class Router extends React.Component { componentDidMount() { if (typeof this.props.homePath === 'string') { - const { pathname, href } = this.getParsedHashPath(); + const { pathname, href } = this.locationHashPath(); if (pathname !== this.props.homePath) { window.location.replace(`#${this.props.homePath}`); const routeConfig = this.routeConfigForPath(pathname); @@ -41,12 +41,12 @@ class Router extends React.Component { } } - window.addEventListener('hashchange', this.onHashChanged); - this.onHashChanged(); + window.addEventListener('hashchange', this.onLocationHashChanged); + this.onLocationHashChanged(); } componentWillUnmount() { - window.removeEventListener('hashchange', this.onHashChanged); + window.removeEventListener('hashchange', this.onLocationHashChanged); } shouldComponentUpdate(nextProps, nextState) { @@ -54,7 +54,7 @@ class Router extends React.Component { nextProps.className !== this.props.className; } - getParsedHashPath = () => { + locationHashPath = () => { const hashPath = window.location.hash.startsWith('#') ? window.location.hash.slice(1) : @@ -75,8 +75,8 @@ class Router extends React.Component { return null; } - onHashChanged = (event) => { - const { pathname, query } = this.getParsedHashPath(); + onLocationHashChanged = (event) => { + const { pathname, query } = this.locationHashPath(); const routeConfig = this.routeConfigForPath(pathname); if (routeConfig === null) { if (typeof this.props.onPathNotMatch === 'function') {