Prefecthing example in docs confusion #3980
-
Hello, I've bee following the docs and I found something strange in the prefetch example, a request with key Edit: please close this, the behaviour has to do with the queryclient defaults |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
because the queryKey changes, and the query has a default staleTime of zero, so you'll get a background refetch. I would use the same staleTime of 10 seconds or so on the query: https://codesandbox.io/s/hopeful-star-l1pf2y?file=/pages/index.js feel free to PR this to the examples if you want |
Beta Was this translation helpful? Give feedback.
because the queryKey changes, and the query has a default staleTime of zero, so you'll get a background refetch. I would use the same staleTime of 10 seconds or so on the query: https://codesandbox.io/s/hopeful-star-l1pf2y?file=/pages/index.js
feel free to PR this to the examples if you want