Skip to content
Discussion options

You must be logged in to vote

because I know for sure the data will not change and I want to only rely on the data coming from the server component.

I'd set staleTime: Infinity on the query and still call useQuery. Without an active observer that gets created by useQuery, data in the cache will be garbage collected after 15 minutes, because its seen as inactive. You can set gcTime (cacheTime in v4) to a higher value to avoid that.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@eeslamadelll
Comment options

@eeslamadelll
Comment options

@TkDodo
Comment options

Answer selected by eeslamadelll
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants