T
TanStack3y ago
sensitive-blue

Hydartion boundary (version 5) Next Js

When using hydration boundary with useInfiniteQuery , then useInfiniteQuery throwing error " Cannot read properties of undefined (reading 'length') at getNextPageParam " server component <HydrationBoundary state={dehydratedState}> <ArticlesContainer view={view} /> </HydrationBoundary> client component const { data, hasNextPage, fetchNextPage, isFetchingNextPage } = useInfiniteQuery({ queryKey: ["posts"], queryFn: async ({ pageParam = 1 }) => { const data = (await getArticles({ pageParam })) as any; return data; }, getNextPageParam: (data) => { if (data.nextPage) { return data.nextPage; } return null; }, initialPageParam: 1, }); If something is wrong , please provide me example
1 Reply
fascinating-indigo
fascinating-indigo3y ago
This is fixed in v5

Did you find this page helpful?