Skip to content

Commit

Permalink
chore(4407): remove prefetch on infninite mutate page
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Rajchert committed Jan 29, 2025
1 parent a0d7800 commit ac85a12
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions apps/web/src/pages/page-with-inf-mutate.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
import {useSuspenseInfiniteQuery} from "@blitzjs/rpc"
import {gSSP} from "src/blitz-server"
import getInfiniteUsers from "src/queries/getInfiniteUsers"
import {useActionState} from "react"

export const getServerSideProps = gSSP(async ({ctx}) => {
const {prefetchInfiniteQuery} = ctx

await prefetchInfiniteQuery(getInfiniteUsers, {}, {})
return {props: {}}
})

function PageWithInfiniteQueryMutate(props) {
const [usersPages, extraInfo] = useSuspenseInfiniteQuery(
getInfiniteUsers,
Expand All @@ -19,7 +11,7 @@ function PageWithInfiniteQueryMutate(props) {
initialPageParam: {take: 3, skip: 0},
},
)
const {isFetching, isFetchingNextPage, fetchNextPage, hasNextPage, setQueryData} = extraInfo
const {isFetchingNextPage, fetchNextPage, hasNextPage, setQueryData} = extraInfo

const onOnContactSave = async (previousState, formData: FormData) => {
const name = formData.get("name")
Expand Down Expand Up @@ -60,7 +52,6 @@ function PageWithInfiniteQueryMutate(props) {

const [, formAction] = useActionState(onOnContactSave, {name: ""})

console.log(usersPages)
return (
<div>
<form action={formAction}>
Expand Down

0 comments on commit ac85a12

Please sign in to comment.