-
Hi, I'm using the code below and it is displaying the first 10 results correctly. When updating the skip variable in the query, nothing happens unless the user leaves the browser window – for example, goes to another application – then comes back to the browser and then the results update. Am I missing a step in the code below?
Thank you! example.mov |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
you need to make actually, all variables should be part of the queryKey. |
Beta Was this translation helpful? Give feedback.
you need to make
skip
part of thequeryKey
. the key is like a dependency array to the query. it's what makes the query decide when it needs to run a request - it's not just requesting on every re-render - only when the key changes (or when you mount a new subscriber, focus the window or reconnect)actually, all variables should be part of the queryKey.