fix(SW-1960): Changes to how we handle hash inside hotelpages after Next15 upgrade
Approved-by: Michael Zetterberg Approved-by: Linus Flood
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
"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)
|
||||
}
|
||||
Reference in New Issue
Block a user