React-Query isRefetching and loading state #2956
Unanswered
AlexMachin1997
asked this question in
Q&A
Replies: 1 comment 2 replies
-
so, hard to say without seeing some code, but usually - and you can check that in all the examples - loading checks for hard loading states and |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I've just started to use react-query at work and it's going pretty well so far, however I've noticed when I re-run the query is re-triggers the main page loader which is triggered (controlled by the
status === "loading"
).What I want to be able to do is some how differentiate so I don't show the main loader when re-running the query I want to show a refetching loader.
Does react-query have a built in way to do this ? Is there some way to combine existing properties to achieve what I want.
I saw in a seperate thread that someone combined isLoading and isRefetching so the check looked something like this:
isLoading && !isRefetching ? 'Main content Loading.....' : <div> Main content {isRefetching ? 'Loading....' : 'Not refetching'}</div>
Would this work ?
Beta Was this translation helpful? Give feedback.
All reactions