Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I clear a query's cache when I have two screens that use the same query, but one uses a param that loads a filtered subset of data? #78

Closed
hoIIer opened this issue Apr 25, 2023 · 1 comment

Comments

@hoIIer
Copy link

hoIIer commented Apr 25, 2023

I have two screens: Items, Historical Items

When the user navigates to Items, it loads the items via useQuery('items'). When the user navigates to Historical Items, it tries to load historical items via useQuery('items', { historical: true }), but instead returns the cached items from the first query.

How can I make sure the historical Items are always loaded separate from regular Items?

@hoIIer
Copy link
Author

hoIIer commented Apr 26, 2023

bah, think I was passing the params incorrectly, fixing to useQuery(['items', { historical: true }]) worked.

@hoIIer hoIIer closed this as completed Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant