Describe the bug#
The types for data when using useSuspenseQueries with combine say that it’s not undefined, but it appears that combine is called when individual queries still have isLoading: true (i.e. before the component unsuspends). I’m not sure if this is a typing bug, or whether combine shouldn’t be called until data is populated (this seems more reasonable to me).
Your minimal, reproducible example#
https://codesandbox.io/p/devbox/elegant-wozniak-tgds5q?file=%2Fsrc%2Findex.tsx
Steps to reproduce#
- Open repro link
- Notice an error right away:
Cannot read properties of undefined (reading 'value')
Expected behavior#
Either a TypeScript error or no runtime error.
How often does this bug happen?#
Every time
Screenshots or Videos#
No response
Platform#
- OS: macOS
- Browser: Chrome
- Version: 123.0
Tanstack Query adapter#
react-query
TanStack Query version#
5.28.9
TypeScript version#
5.4.3
Additional context#
No response
I'm pretty sure combine shouldn't run until the queries finish suspending. Will take a look