fix(SW-2933): Making the hotels/city listing render correct for SEO purposes
Approved-by: Matilda Landström
This commit is contained in:
@@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user