-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Fix useInfiniteQuery suspense bug #2119
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
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/tannerlinsley/react-query/7VPS3U8EZsuUoa3L7RjcXX81fD5C |
| expect(states.length).toBe(3) | ||
| expect(states[2]).toMatchObject({ | ||
| data: { pages: [2], pageParams: [undefined] }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was surprising to me that states here is length 3 instead of 2, but I'm assuming this is expected.
|
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 3a3ecee:
|
|
Awesome! The behavior was indeed missing but should be added in InfiniteQueryObserver.getOptimisticResult so it will also be fixed for other frameworks |
|
@boschni thanks! I pushed a commit that makes that change. Tests pass, but I had to do a type cast. Not sure if that's ok? If not, can you give some guidance on how to fix? |
|
lgtm! |
|
🎉 This PR is included in version 3.13.9 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Closes: #2095
This fixes the useInfiniteQuery suspense bug where
options.behaviorwas missing and soinfiniteQueryBehavior.onFetchwas not being called, resulting incorrect querydata.