tRPC experimental_defer compatibility with useSuspenseQuery
0 reputation · 22 Sept 2021, 02:51 UTC
The experimental_defer feature in tRPC v10 allows for the deferral of query execution to optimize initial page loads by delaying specific data fetching until the component mounts.
Current documentation indicates that this functionality is designed to work with standard useQuery hooks. However, there is a known gap regarding its interaction with useSuspenseQuery, which relies on a different execution model for handling asynchronous states during the render phase.
Integrating these two features creates uncertainty regarding how the deferral mechanism handles the suspension lifecycle without triggering hydration mismatches or blocking the initial render.
- Does
experimental_deferprovide a mechanism to bypass the immediate suspension ofuseSuspenseQuery? - What is the expected behavior when a deferred query is called within a Suspense boundary?