Skip to content

RTKQ - How can I always fetch on first render? #3007

Answered by markerikson
LoyalPotato asked this question in Q&A
Discussion options

You must be logged in to vote

@LoyalPotato : that's one of the main purposes of RTKQ - to reuse cached data without having to re-fetch it every time.

If you really want to refetch when a different component mounts, use the refetchOnMountOrArgChange in either createApi or the hook call itself.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@LoyalPotato
Comment options

Answer selected by LoyalPotato
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants