Next.js - ReactQuery data is being refetched everytime route changes.
Hello. I made this simple demo, where react query forces refetch every time route changes, I want to disable this behavior. Is it possible?
It does refetch only when previous response has been unsuccessful. In my specific example where I am getting user from API, I don't really want this kind of behavior, because it shows loading animation on every page change.
My default query client options:
Demo: https://codesandbox.io/s/silly-ptolemy-x0e0ih?file=/components/Nav.tsx
0 Replies