Files
web/hooks/useHash.tsx

16 lines
331 B
TypeScript

"use client"
import { useParams } from "next/navigation"
import { useEffect, useState } from "react"
export default function useHash() {
const [hash, setHash] = useState<string | undefined>(undefined)
const params = useParams()
useEffect(() => {
setHash(window.location.hash)
}, [params])
return hash?.slice(1)
}