Skip to content

Commit

Permalink
fix(examples:react:infinite-scroll): fix type error (#781)
Browse files Browse the repository at this point in the history
  • Loading branch information
SaeWooKKang committed Jul 30, 2024
1 parent f553d06 commit eb480b4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/react/infinite-scroll/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ function App() {
fetchNextPage,
hasNextPage,
} = useInfiniteQuery({
queryKey: 'projects',
queryKey: ['projects'],
queryFn: (ctx) => fetchServerPage(10, ctx.pageParam),
getNextPageParam: (_lastGroup, groups) => groups.length,
initialPageParam: 1,
})

const allRows = data ? data.pages.flatMap((d) => d.rows) : []
Expand Down Expand Up @@ -85,7 +86,7 @@ function App() {
<br />
<br />

{status === 'loading' ? (
{status === 'pending' ? (
<p>Loading...</p>
) : status === 'error' ? (
<span>Error: {(error as Error).message}</span>
Expand Down

0 comments on commit eb480b4

Please sign in to comment.