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
fix(useQuery): don't throw error if errorBoundary has just been reset #2935
fix(useQuery): don't throw error if errorBoundary has just been reset #2935
Conversation
the fix for disabled queries was wrong, because disabled queries still need to throw if they are fetching due to some other means, like `refetch`. However, if a query has just been reset, we want to skip throwing for one render cycle. The useEffect that clears the reset will then make sure that further errors will be thrown
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/tanstack/react-query/5WWq937PQ59BjwFADxoPoNK57TYt |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit df2ea39:
|
Codecov Report
@@ Coverage Diff @@
## master #2935 +/- ##
=======================================
Coverage 96.40% 96.40%
=======================================
Files 45 45
Lines 2227 2227
Branches 637 637
=======================================
Hits 2147 2147
Misses 77 77
Partials 3 3
Continue to review full report at Codecov.
|
@WeiShengv99 I tried your lates example with this preview, and it seems to work fine: https://codesandbox.io/s/tannerlinsley-react-query-basic-forked-vspe0?file=/src/index.js |
🎉 This PR is included in version 3.32.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Yes, this pr fixed my problem.
if --------------------------------------update--- i find your explanation about why sync the data Thank you! i know what should i do now. |
the fix for disabled queries was wrong, because disabled queries still need to throw if they are fetching due to some other means, like
refetch
. However, if a query has just been reset, we want to skip throwing for one render cycle. The useEffect that clears the reset will then make sure that further errors will be thrown