Skip to content
Discussion options

You must be logged in to vote

I think the loading state is exactly what you want, from the docs:

loading if the query is in a "hard" loading state. This means there is no cached data and the query is currently fetching, eg isFetching === true

status === 'loading or isLoading === true will only be set for the "initial" fetch, where you have no data yet, while isFetching === true will be set every time a request goes out, either for the initial one or a background fetch.

I usually show a big loading spinner for isLoading and a small one somewhere else on the page to indicate background fetching via isFetching && !isLoading (joining both conditions here so that we don't get two spinners).

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by shaneajeffery
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants