How should i refetch with same filters after set state? #5194
-
Hi, I came across with filters when filtering using react query with tables. After i filtered some values for the 1st time, react query does not refetch again with the same value for 2nd time, and i wanted it to refetch because there might be newer data during the state time and yet to display to user at instant. Please do advise me any method and below is a mock example.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi 👋 If you're setting the ID to the same value as it was previously, and you're leveraging caching, then this won't trigger a refetch. Is this some form of refresh button from which you want to refresh data? If so, you might want to invalidate that query instead. |
Beta Was this translation helpful? Give feedback.
Hi 👋
If you're setting the ID to the same value as it was previously, and you're leveraging caching, then this won't trigger a refetch.
Is this some form of refresh button from which you want to refresh data? If so, you might want to invalidate that query instead.