Skip to content

Infinite loop when to Suspense mode with cacheTime: 0 #2367

@nghiepdev

Description

@nghiepdev

Describe the bug
Suspense mode does not working when to set cacheTime: 0, data will never resolve and infinite loop API call.
I just fork example from https://react-query.tanstack.com/guides/suspense and add cacheTime: 0 option.

To Reproduce
https://codesandbox.io/s/confident-darwin-6oz9t?file=/src/index.js
Steps to reproduce the behavior:

  1. Click on "Show Project" button
  2. Check the Network tab
  3. See loop problem

Screenshots
image

Desktop (please complete the following information):

  • OS: macOS
  • Browser: Chrome
  • Version: 3.17.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions