feat: ReactQueryStreamedHydration
This commit is contained in:
1 parent
0e146b0c53
commit
e9c0f3bef3
12 files changed
+71
-52
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { dehydrate, HydrationBoundary } from '@tanstack/react-query';
|
||||
import { ReactQueryStreamedHydration } from '@tanstack/react-query-next-experimental';
|
||||
import { Metadata } from 'next';
|
||||
|
||||
import UsersList from '@/components/UsersLists';
|
||||
@@ -20,13 +21,13 @@ const WatchList = async () => {
|
||||
const showType = 'movie';
|
||||
|
||||
if (session) {
|
||||
await queryClient.prefetchInfiniteQuery(usersShowsQuery({ showType, list, session }));
|
||||
queryClient.prefetchInfiniteQuery(usersShowsQuery({ showType, list, session }));
|
||||
}
|
||||
|
||||
return (
|
||||
<HydrationBoundary state={dehydrate(queryClient)}>
|
||||
<ReactQueryStreamedHydration>
|
||||
<UsersList session={session} list={list} label='watch' />
|
||||
</HydrationBoundary>
|
||||
</ReactQueryStreamedHydration>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user