-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Description
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:
- Click "show projects".
- Open one of the projects
- Go back to the list of projects
- Change
shouldThrowto true - Open a project again -> this should throw the error
- Change the
shouldThrowto false - 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.