Files
supabase/apps/studio/hooks/misc/useCurrentPath.tsx
Jordi Enric 33abcaa873 fix url query breaking active tab (#25953)
* fix

* rm unused arg

* forwardRef NavMenuItem
2024-05-28 11:03:22 +02:00

15 lines
265 B
TypeScript

import { useRouter } from 'next/router'
export const useCurrentPath = () => {
const router = useRouter()
if (!router.isReady) {
return ''
}
const pathWithQuery = router.asPath
const currentPath = pathWithQuery.split('?')[0]
return currentPath
}