We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 167db32 commit 14c0ec8Copy full SHA for 14c0ec8
docs/framework/vue/guides/infinite-queries.md
@@ -10,7 +10,7 @@ ref: docs/framework/react/guides/infinite-queries.md
10
<script setup>
11
import { useInfiniteQuery } from '@tanstack/vue-query'
12
13
-const fetchProjects = async ({ pageParam = 0 }) => {
+const fetchProjects = async ({ pageParam }) => {
14
const res = await fetch('/api/projects?cursor=' + pageParam)
15
return res.json()
16
}
@@ -27,6 +27,7 @@ const {
27
} = useInfiniteQuery({
28
queryKey: ['projects'],
29
queryFn: fetchProjects,
30
+ initialPageParam: 0,
31
getNextPageParam: (lastPage, pages) => lastPage.nextCursor,
32
})
33
</script>
0 commit comments