Skip to content

QueryErrorResetBoundary does not reset the state of the query #1863

@Trancever

Description

@Trancever

Describe the bug

QueryErrorResetBoundary does not seem to reset the query in suspense mode.

To Reproduce
Steps to reproduce the behavior:

https://codesandbox.io/s/sweet-greider-edmen

It's a slightly changed suspense example. I added a button that toggles a shouldThrow state. shouldThrow is passed to the Project component and based on its value, fetch function throws or fetches the data from API.

Steps to reproduce:

  1. Click "show projects".
  2. Open one of the projects
  3. Go back to the list of projects
  4. Change shouldThrow to true
  5. Open a project again -> this should throw the error
  6. Change the shouldThrow to false
  7. Click "try again" -> this will throw again, but shouldn't

Expected behavior
After calling reset all queries nested in QueryErrorResetBoundary should be reset to some default state and they should try to fetch the data again.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
  • Version: latest

Smartphone (please complete the following information):

  • Device: iPhone X
  • OS: iOS 14
  • Browser: React-Native
  • Version: latest Expo

Additional context
This happens in both react and react-native.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions