upd
This commit is contained in:
@@ -22,13 +22,14 @@ const Navbar = () => {
|
||||
|
||||
useEffect(() => {
|
||||
const pathname = location.pathname;
|
||||
console.log(pathname);
|
||||
const tab = tabs.find((tab) => tab.path === pathname);
|
||||
const defaultTab = tabs[0];
|
||||
if (tab) {
|
||||
setSelectedTab(tab);
|
||||
} else {
|
||||
setSelectedTab(defaultTab);
|
||||
setSelectedTab(null);
|
||||
}
|
||||
console.log("tab", tab);
|
||||
}, [location.pathname]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user