Killing The Spinner Hybrid Data Fetching For Better UX - Rody Gosset
summary
Muse at the French National Museum of Natural History uses server-streamed prefetch with React Server Components and Suspense plus TanStack Query to hydrate a client cache that persists to local storage persistence. The app prefetches queries on the server without blocking, streams resolved promises in the HTML, dehydrates the QueryClient into the browser, and then uses useSuspenseQuery so subsequent navigations are instant instead of spinner-filled. The hybrid pattern reduces waterfalls and speeds UX.
AI-written summary · about
