Skip to content

Suspense loader not retriggered if query is invalidated #1065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andrewnaeve opened this issue Sep 20, 2020 · 2 comments
Closed

Suspense loader not retriggered if query is invalidated #1065

andrewnaeve opened this issue Sep 20, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@andrewnaeve
Copy link

andrewnaeve commented Sep 20, 2020

Describe the bug
If a query is invalidated because data needs to be refetched, the React Suspense loading state is not also re-triggered.

Expected Behavior
I would expect the fallback to retrigger when:

  • The query is invalidated. A loader is appropriate because the data is invalid, and refetching must occur.
  • The refetch function is called

I would not expect the fallback to retrigger if:

  • The query is "refetched" by setting the refetch prop, as polling may be wanted in the background without disrupting the current screen.

To Reproduce
See codepen here:
https://codesandbox.io/s/charming-joliot-nm1pt?file=/src/index.js

@tannerlinsley
Copy link
Collaborator

This may be related to #1059?

@boschni
Copy link
Collaborator

boschni commented Sep 26, 2020

Its not exactly the same issue, but it is related because we need to explicitly define the behavior of suspense in several scenarios, including this one. Closing this issue in favor of #1059

@boschni boschni closed this as completed Sep 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants