Like subscribing to a newspaper — you have the latest issue immediately; a fresh one is delivered in the background.
useQuery fetches data and provides isLoading, error, and data states. It caches by queryKey and shares data across components with the same key.
> useQuery ["user", 42]
> Cache miss → fetching
> data: {id:42, name:"Alice"}
> Cached for 5 minutesLike subscribing to a newspaper — you have the latest issue immediately; a fresh one is delivered in the background.
useQuery fetches data and provides isLoading, error, and data states. It caches by queryKey and shares data across components with the same key.
> useQuery ["user", 42]
> Cache miss → fetching
> data: {id:42, name:"Alice"}
> Cached for 5 minutesSign in to cast your vote
Sign in to share your feedback and join the discussion.