fix: back to prefetch

This commit is contained in:
ner committed 2024-10-29 18:25:52 +02:00
1 parent a268f7c38d
commit c9ca262da8
14 files changed
+180 -27

No files matched your search

+14 -1
View File
@@ -1,6 +1,9 @@
import { dehydrate, HydrationBoundary } from '@tanstack/react-query';
import { Metadata } from 'next';
import popularQuery from '@/data/queries/popular';
import { TITLE } from '@/env';
import getQueryClient from '@/lib/queryClient';
import Container from './container';
@@ -9,6 +12,16 @@ export const metadata: Metadata = {
description: `Check out the most popular movies right now on ${TITLE}. See what’s trending and don’t miss out on the latest hits.`
};
const Popular = () => <Container />;
const Popular = () => {
const queryClient = getQueryClient();
queryClient.prefetchInfiniteQuery(popularQuery());
return (
<HydrationBoundary state={dehydrate(queryClient)}>
<Container />
</HydrationBoundary>
);
};
export default Popular;