pass event argument instead of hashPath when hash not match

This commit is contained in:
NikolaBorislavovHristov 2019-04-21 21:03:28 +03:00
parent a198c81aaa
commit 9e8aaaf281

View file

@ -81,7 +81,7 @@ class Router extends React.Component {
const routeConfig = this.routeConfigForPath(hashPath);
if (routeConfig === null) {
if (typeof this.props.onPathNotMatch === 'function') {
this.props.onPathNotMatch(hashPath);
this.props.onPathNotMatch(event);
} else if (typeof this.props.homePath === 'string') {
window.location.replace(`#${this.props.homePath}`);
}