usePaginationQuery double request #1287
-
Hi, I have a question regarding Why is it firing two requests when I click on the prev/next page buttons? Here is code sandbox: https://codesandbox.io/s/sweet-brattain-5fkyf |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think what you are probably seeing is that you focus the window at the same time as clicking the next button. This will first trigger the So try clicking somewhere else on the page, observe the focus refetch, and then click on the next button - it seems to work just fine :) |
Beta Was this translation helpful? Give feedback.
I think what you are probably seeing is that you focus the window at the same time as clicking the next button. This will first trigger the
refetchOnWindowFocus
, which will fetch the current page, and then click the button and go to the next page. It happens quite frequently if you switch between the devtools and the actual app.So try clicking somewhere else on the page, observe the focus refetch, and then click on the next button - it seems to work just fine :)