fix(SW-2933): Making the hotels/city listing render correct for SEO purposes

Approved-by: Matilda Landström
This commit is contained in:
Erik Tiekstra
2025-06-04 09:05:05 +00:00
parent 0bd78bc7a6
commit a8f167025d
9 changed files with 75 additions and 40 deletions

View File

@@ -1,5 +1,5 @@
"use client"
import { usePathname } from "next/navigation"
import { usePathname, useSearchParams } from "next/navigation"
import { useRef } from "react"
import { createDestinationDataStore } from "@/stores/destination-data"
@@ -19,6 +19,7 @@ export default function DestinationDataProvider({
}: DestinationDataProviderProps) {
const storeRef = useRef<DestinationDataStore>(undefined)
const pathname = usePathname()
const searchParams = useSearchParams()
if (!storeRef.current) {
storeRef.current = createDestinationDataStore({
@@ -26,6 +27,7 @@ export default function DestinationDataProvider({
allHotels,
pathname,
sortItems,
searchParams,
})
}