How to prevent cached data being shown until a button is clicked #8449
-
What we require is to have all fetching of data behind an "Apply" button. To do this, I've used The problem I'm running into is with How do I get around this though, to be able to only get the data, cached or from the api, when the button is clicked |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I think I've found a solution from: https://tkdodo.eu/blog/effective-react-query-keys#automatic-refetching which is to not use |
Beta Was this translation helpful? Give feedback.
I think I've found a solution from: https://tkdodo.eu/blog/effective-react-query-keys#automatic-refetching which is to not use
refetch
but instead to store the filter state (I'm using jotai so in an atom) and when the apply button is clicked to update the state with the new filters