T
TanStack13mo ago
evident-indigo

How to avoid triggering suspense fallback when using ssr prefetch+suspense after first render.

I have a component that uses useSuspenseQuery and the page uses prefetchQuery. The project is a next.js app router app. The client component has buttons that changes the params used in the query. Every change triggers the suspense fallback. Is there anyway to just render the suspense fallback for the initial render?
4 Replies
passive-yellow
passive-yellow13mo ago
TanStack | High Quality Open-Source Software for Web Developers
Headless, type-safe, powerful utilities for complex workflows like Data Management, Data Visualization, Charts, Tables, and UI Components.
From An unknown user
From An unknown user
evident-indigo
evident-indigoOP13mo ago
I found this article
evident-indigo
evident-indigoOP13mo ago
Exploring using Suspense with React Query
Learn how I explored using Suspense with React Query and what issues I encountered and how I solved them.
evident-indigo
evident-indigoOP13mo ago
useTransition solved the problem for me

Did you find this page helpful?