mirror of
https://github.com/supabase/supabase.git
synced 2026-07-03 11:14:34 +08:00
15 lines
265 B
TypeScript
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
|
|
}
|