Replies: 1 comment
-
Judging from the code, cancelling a query should abort the page refetching. Can you create a minimal codesandbox reproduction that shows your issue please? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am using
useInfiniteQuery
, and hasrefetchOnWindowFocus: true
,when i focused to the window, it executes codes inside
getNextPageParam
,during the sequence of fetching, user can choose to back to previous page, (we are not unmounting the component for some reason)
i tried to run
queryClient.cancelQueries(['searchShipmentQuery'])
when user clicked back to previous page it doesn't cancel the background fetching. It still running and console logging. (Seeconsole.log('getNextParam Triggered')
)when clicked back to previous page, i do set the
enabled: false
(by setting the searchPayload to empty, resolved tofalse
)yet the background fetching still running until it is out of pages,
how to cancel it?
here is code block executed if user clicked back button
Beta Was this translation helpful? Give feedback.
All reactions