prefetchInRender
causes infinite render loop with deferred value if a promise rejects
#8249
Labels
prefetchInRender
causes infinite render loop with deferred value if a promise rejects
#8249
Describe the bug
When the query of a deferred component rejects, it falls into an infinite render loop. This is consistent and I have written a test case.
I was waiting to see if this was being caused by #8219, but it appears not. Here's the test:
It currently fails waiting for the error boundary because of the infinite render. If you catch the
waitFor
throw, you will notice very large values forrenderCount
:The same issue occurs when removing
useDeferredValue
, and updating the count within astartTransition
instead.Your minimal, reproducible example
Failing test provided
Steps to reproduce
N/A
Expected behavior
N/A
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
OS: Windows 11
Browser: Chrome
Version: 129.0
Tanstack Query adapter
react-query
TanStack Query version
06e315c
TypeScript version
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: