Files
EMS-ESP32/interface/src/components/routing/useRouterTab.ts
proddy 9bf7fbfb2e #1665
2024-03-17 19:08:03 +01:00

9 lines
271 B
TypeScript

import { useMatch, useResolvedPath } from 'react-router-dom';
export const useRouterTab = () => {
const routerTabPathMatch = useMatch(useResolvedPath(':tab').pathname);
const routerTab = routerTabPathMatch?.params?.tab || false;
return { routerTab } as const;
};