State Management · Middle · Question 38 of 75
What does the refetchOnMountOrArgChange option do in RTK Query?
- ✓Correct answer: Forces a refetch when a component mounts or the argument changes, even if cached
- 2Disables caching for the endpoint completely
- 3Refetches the data every second
Explanation
By default RTK Query serves cached data to new subscribers. refetchOnMountOrArgChange: true (or a number of seconds) refetches if the data is older than that. Related options: refetchOnFocus, refetchOnReconnect, pollingInterval.