NavBarButton ensure type of active is boolean

This commit is contained in:
NikolaBorislavovHristov 2019-08-22 16:26:53 +03:00
parent 929fc486ea
commit 5203f6ef97

View file

@ -24,7 +24,7 @@ const NavBarButton = ({ className, icon = '', label = '', href = '', onClick })
const active = React.useMemo(() => {
if (routeRegexp !== null) {
const { pathname: locationPathname } = UrlUtils.parse(locationHash.slice(1));
return routeRegexp.exec(locationPathname);
return !!routeRegexp.exec(locationPathname);
}
return false;