Skip to content
Source
Sign inSign up
TanStack/query

devtools: "trigger loading" button changes state when "refetch" is clicked #5959

Send to my agent
ClosedTkDodo opened this issue 5 comments
TkDodocommented

can be seen in the simple example in the docs:

https://tanstack.com/query/v5/docs/react/examples/react/simple

  • click refetch
  • observe that while the fetch is going on, trigger loading switches to restore loading
  • the button switches back to its normal state when the fetch finishes

screencast 2023-09-05 11-35-46

  1. TkDodo added labelspackage: query-devtools

  2. TkDodo added labelsv5

  3. I think this is fixed, I can't reproduce this anymore

  4. @judicaelandria no work has been done on this, the simple example still shows this error (api is pretty fast, in the gif, I slowed it down)

  5. I had a closer look and I think that's expected because firing the refetch make the statusLabel update to fetching more https://github.com/TanStack/query/blob/2d41d98854b919168b4ac158983a59e2176efa67/packages/query-devtools/src/Devtools.tsx#L1037

    or there is a context I'm missing (if not that's expected)

  6. I'd say its not expected that this happens. We have a separate state for restore loading:

    https://github.com/TanStack/query/blob/2d41d98854b919168b4ac158983a59e2176efa67/packages/query-devtools/src/Devtools.tsx#L813

    So I guess we should use that one ?

  7. yes I think so too, I'll update the condition and will send a pr

  8. TkDodo closed this

Sign in to join this conversation.