T
TanStack7mo ago
like-gold

Does useQuery run twice in strict mode? Because for me it doesn't

I'm running this query:
const { data } = useQuery({
queryKey: ['workoutSessions'],
queryFn: () => fetchWorkoutSessions(auth.userId),
});
const { data } = useQuery({
queryKey: ['workoutSessions'],
queryFn: () => fetchWorkoutSessions(auth.userId),
});
I expected it to run twice in strict mode, but it's only sending one request?
1 Reply
stormy-gold
stormy-gold7mo ago
No, it deduplicates unless you opt in to query cancellation

Did you find this page helpful?