Merged in fix/suspense-key (pull request #1356)
feat: suspense key - use json-stable-stringify for suspense key * feat: suspense key - use json-stable-stringify for suspense key Approved-by: Joakim Jäderberg
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { differenceInCalendarDays, format, isWeekend } from "date-fns"
|
||||
import stringify from "json-stable-stringify-without-jsonify"
|
||||
import { notFound } from "next/navigation"
|
||||
import { Suspense } from "react"
|
||||
|
||||
@@ -96,17 +97,14 @@ export default async function SelectRatePage({
|
||||
const hotelId = +hotel.id
|
||||
|
||||
const booking = convertSearchParamsToObj<SelectRateSearchParams>(searchParams)
|
||||
|
||||
const suspenseKey = stringify(searchParams)
|
||||
return (
|
||||
<>
|
||||
<Suspense fallback={<HotelInfoCardSkeleton />}>
|
||||
<HotelInfoCard hotelData={hotelData} />
|
||||
</Suspense>
|
||||
|
||||
<Suspense
|
||||
key={JSON.stringify(searchParams)}
|
||||
fallback={<RoomsContainerSkeleton />}
|
||||
>
|
||||
<Suspense key={suspenseKey} fallback={<RoomsContainerSkeleton />}>
|
||||
<RoomsContainer
|
||||
adultArray={adultsInRoom}
|
||||
booking={booking}
|
||||
@@ -117,7 +115,7 @@ export default async function SelectRatePage({
|
||||
toDate={departureDate}
|
||||
/>
|
||||
</Suspense>
|
||||
<Suspense fallback={null}>
|
||||
<Suspense key={suspenseKey} fallback={null}>
|
||||
<TrackingSDK
|
||||
pageData={pageTrackingData}
|
||||
hotelInfo={hotelsTrackingData}
|
||||
|
||||
Reference in New Issue
Block a user