Skip to content

With keepPreviousData on, the status doesn't change to loading #1238

Answered by TkDodo
hmbrg asked this question in Ideas
Discussion options

You must be logged in to vote

The loading state signalizes a "hard" loading - which means a state where you have no data yet and also no error. You want to always show a loading spinner / indicator here.

This is the state we want to avoid with keepPreviousData, so this is intentional. What you are looking for is probably the isFetching flag that is also returned. This flag is true whenever a request is going out, no matter why. So it will also be true for background refetches, like when you focus the window or when you are fetching with previous data kept like in your example.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by hmbrg
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
Ideas
Labels
None yet
3 participants