1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00
vault-frontend/src/hooks/node/useNodePageParams.ts
2022-01-17 16:13:45 +07:00

9 lines
295 B
TypeScript

import { useRouteMatch } from 'react-router';
import { useRouter } from 'next/router';
import { CONFIG } from '~/utils/config';
export const useNodePageParams = () => {
return CONFIG.isNextEnvironment
? (useRouter().query.id as string)
: useRouteMatch<{ id: string }>().params.id;
};