revert back to absolute routing

This commit is contained in:
Proddy
2023-12-10 14:50:34 +01:00
parent c9ca395e6d
commit faa21abe54
9 changed files with 44 additions and 36 deletions

View File

@@ -1,12 +1,12 @@
import { useMatch, useResolvedPath } from 'react-router-dom';
import { useLocation } from 'react-router-dom';
export const useRouterTab = () => {
// const loc = useLocation().pathname;
// const routerTab = loc.substring(0, loc.lastIndexOf('/')) ? loc : false;
const loc = useLocation().pathname;
const routerTab = loc.substring(0, loc.lastIndexOf('/')) ? loc : false;
const routerTabPath = useResolvedPath(':tab');
const routerTabPathMatch = useMatch(routerTabPath.pathname);
const routerTab = routerTabPathMatch?.params?.tab || false;
// const routerTabPath = useResolvedPath(':tab');
// const routerTabPathMatch = useMatch(routerTabPath.pathname);
// const routerTab = routerTabPathMatch?.params?.tab || false;
return { routerTab } as const;
};