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,3 +1,4 @@
|
||||
import stringify from "json-stable-stringify-without-jsonify"
|
||||
import { Suspense } from "react"
|
||||
|
||||
import SelectHotel from "@/components/HotelReservation/SelectHotel"
|
||||
@@ -13,11 +14,10 @@ export default async function SelectHotelPage({
|
||||
}: PageArgs<LangParams, SelectHotelSearchParams>) {
|
||||
setLang(params.lang)
|
||||
|
||||
const suspenseKey = stringify(searchParams)
|
||||
|
||||
return (
|
||||
<Suspense
|
||||
key={JSON.stringify(searchParams)}
|
||||
fallback={<SelectHotelSkeleton />}
|
||||
>
|
||||
<Suspense key={suspenseKey} fallback={<SelectHotelSkeleton />}>
|
||||
<SelectHotel params={params} searchParams={searchParams} />
|
||||
</Suspense>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user