additional validation to the href prop added to NavTabButton

This commit is contained in:
NikolaBorislavovHristov 2019-09-19 11:56:46 +03:00
parent 97b2244e3e
commit ca2ca88a44

View file

@ -9,7 +9,7 @@ const styles = require('./styles');
const NavTabButton = ({ className, icon, label, href, onClick }) => {
const routeRegexp = React.useMemo(() => {
if (typeof href === 'string') {
if (typeof href === 'string' && href.startsWith('#')) {
for (const { regexp } of Object.values(routesRegexp)) {
if (href.slice(1).match(regexp)) {
return regexp;