Files
movie-advisor/app/(site)/popular/page.tsx
T

32 lines
802 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { dehydrate, HydrationBoundary } from '@tanstack/react-query';
import { Metadata } from 'next';
import { popularMovies } from '@/api';
import getQueryClient from '@/lib/queryClient';
import Container from './container';
export const metadata: Metadata = {
title: 'Popular Movies | Movie Advisor',
description:
'Check out the most popular movies right now on Movie Advisor. See what’s trending and don’t miss out on the latest hits.'
};
const Popular = () => {
const queryClient = getQueryClient();
queryClient.prefetchInfiniteQuery({
queryKey: ['popular'],
queryFn: () => popularMovies(),
initialPageParam: '1'
});
return (
<HydrationBoundary state={dehydrate(queryClient)}>
<Container />
</HydrationBoundary>
);
};
export default Popular;