Skip to content

initial status set to "loading"problem #6112

Answered by TkDodo
MoeHamdan asked this question in Q&A
Discussion options

You must be logged in to vote

it is documented that it starts in status: 'loading' here:

https://tanstack.com/query/v4/docs/react/guides/dependent-queries#usequery-dependent-query

I would expect to either have the old status "Idle" or add new status call it "initial" or the like. It does not make sense to have the intial status "loading" while the query did not execute at all.

There won't be a 4th state because that complicates states for every case where you're not using enabled. The rationale is documented here: https://tanstack.com/query/v4/docs/react/guides/queries#why-two-different-states

In v5, the loading state is renamed to pending to make it less confusing. pending can hopefully be better associated with th…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by MoeHamdan
Comment options

You must be logged in to vote
0 replies
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
Converted from issue

This discussion was converted from issue #6111 on October 06, 2023 12:07.