diff --git a/src/search/preview/data.ts b/src/search/preview/data.ts index 0d3d096f..6dae36ac 100644 --- a/src/search/preview/data.ts +++ b/src/search/preview/data.ts @@ -1,7 +1,7 @@ /* eslint-disable lingui/no-unlocalized-strings */ import { CountryDomain } from "@/user/views/user/search/types"; import { buildAdServerEndpoint } from "@/util/environment"; -import useSWR from "swr"; +import useSWRImmutable from "swr/immutable"; /* this is the data we get back from the server */ interface ServerSearchData { @@ -57,7 +57,7 @@ const fetcher = (suffix: string) => export function useLandingPageData( slug: string, ): UseSearchDataReturn { - const { data, isLoading } = useSWR(slug, fetcher); + const { data, isLoading } = useSWRImmutable(slug, fetcher); if (!data) { return { loading: isLoading }; @@ -80,7 +80,7 @@ export function useKeywordData( landingPageUrl: string, ): UseSearchDataReturn { const qs = new URLSearchParams({ url: landingPageUrl }); - const { data, isLoading } = useSWR( + const { data, isLoading } = useSWRImmutable( `${slug}/keywords?${qs}`, fetcher, );