-
In one page I requested classroom students data.
And In another page, I used that data again with queryClient. But this Is there any way to refetch students when the query data is accessed? I want the fetch api is called automatically in the background when the cached data is removed by page refreshing. Using persist query or session seems not good way. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Don't use queryClient.getQueryData in a component - always useQuery. That way, mounting of a new component will trigger a background refetch. |
Beta Was this translation helpful? Give feedback.
Don't use queryClient.getQueryData in a component - always useQuery. That way, mounting of a new component will trigger a background refetch.