-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
useInfiniteQuery
broken on SSR
#1794
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
Comments
Does version 3.9.3 fix your issue? |
Yeah! That works perfectly - cheers |
Brainfart on my end. The above reproductions still don't work as of 3.9.6 |
I'm seeing similar issue where data is not added in |
This seems to work: 2bcc893 Are you using |
Oh I guess I did use the wrong prefetch method in my test up there. But what I'm experiencing in my real app is with using Suspense-based SSR via |
Added a test for suspense and infinite queries: ff619d0 Are you sure it does not work with 3.9.6? |
That seems to do the trick 😁 Yes! |
Describe the bug
As of 3.9.0
useInfiniteQuery
behaves differently during SSR, only returning the request data atQueryResult.data
rather than each paginated page atQueryResult.data.pages
. But behaves as documented when rerendered client-side.To Reproduce
Steps to reproduce the behavior:
Change the current nextjs example to use
useInfiniteQuery
like so: https://github.com/klarstrup/react-query/commit/c2434e563038a7adf9013b30fc916276c3efda3cI've also written a shoddy little test to confirm the issue: https://github.com/klarstrup/react-query/commit/4f3b37096b8457e742652abab88d4a7b3732ee95
Expected behavior
I would expect the query hooks to not behave different between server and client.
I would hazard a guess that this is fallout from #1775
The text was updated successfully, but these errors were encountered: