Skip to content
Discussion options

You must be logged in to vote
  1. if you want to return something empty from the queryFn, it can't be undefined - it has to be null or something else. This is independent of suspense - undefined is reserved for pending or error state, and we use it to bail out of state updates, too. It can't be used for a "successful" query.
  2. The flags are there because we return the same thing as useQuery. Internally, the same observer is used, and that's where the result comes from. But you should see that some of these flags, like isPending, have a fixed value, and status is just success or error. Background refetches can still happen and they can also error, which means your query can be in error state and render accordingly. We think…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
5 replies
@artem-malko
Comment options

@TkDodo
Comment options

@artem-malko
Comment options

@TkDodo
Comment options

@artem-malko
Comment options

Comment options

You must be logged in to vote
2 replies
@TkDodo
Comment options

Answer selected by artem-malko
@artem-malko
Comment options

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