Replies: 1 comment
-
The example you are describing is actually the behaviour how it should be. every time you change the query key, react-query will create a new entry in the cache. Unless you tinkered with the Do you have a reproducible example for your observed behaviour, in a codesandbox maybe? The only way I can see this happen is if:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi 👋
I'm trying to integrate
usePaginatedQuery
into our project however I'm having some problems with caching.I have a dynamic cache key based on the search query input and page user is currently on:
Every time
query
changes,react-query
will call the fetch function. Is that expected behaviour? I would expect the result to be returned from cache after user enters a value that was previously fetched before.Expected behaviour:
I can manually add the check inside the callback function, but then I lose benefits of refetch on focus etc...
Beta Was this translation helpful? Give feedback.
All reactions