Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 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.
-
I have a query that uses
placeholderData: keepPreviousData
. This means that on initial mount, the query is in a hard loading state, with no placeholder data. Then, when the queryKey changes, it goes into a 'soft' loading state: placeholder data shown,isPlaceholderData=true
andisLoading=false
.My component looks like this:
Now, somewhere far away in the component tree, I need to put exampleQ back into the soft loading state, with
isLoading=false, isPlaceholderData=true
. I then wait some time for something unrelated. When ready, I want the query to refetch and continue to display the placeholderData while refetching.I've tried every combination of QueryClient methods that I can think of and none of them put the query back to the soft loading state in a way that I can tell the difference between that and background refreshes. What is the right way to accomplish this?
isPlaceholderData=true
so my component can't tell if its background refetching or or not.isPlaceholderData=true
Beta Was this translation helpful? Give feedback.
All reactions