const [,, section] = location.pathname.split('/');
const alias = items.find(({ alias }) => alias === section);
if (alias) {
window.location.hash = alias.isRoot
? basePath
: `${basePath}/${alias.name}`;
} else if (hidden.includes(section) || !items.some(({ isRoot, name }) => !isRoot && name === section)) {
window.location.hash = basePath;
}
}
}, [basePath, hidden, items, location]);
return (
{items
.filter(({ name }): boolean => !hidden.includes(name))
.map(renderItem(props))
}
);
}
export default React.memo(Tabs);