Skip to content

Suspense loader not retriggered if query is invalidated #1065

@andrewnaeve

Description

@andrewnaeve

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions