Skip to content

How get queryCache data correctly #195

Closed Answered by posva
smaylninja asked this question in Questions
Discussion options

You must be logged in to vote

Since props is reactive, you need a getter:

const { isLoading } = useQuery({
  key: () => ["emails", props.id],
  query: () => emailStore.getIncomingEmail(props.id),
  staleTime: 5 * 60 * 1000,
});

Right now you are overriding the same entry every time

Replies: 1 comment 3 replies

Comment options

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

@posva
Comment options

@smaylninja
Comment options

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