import React from 'react' import { HydrationBoundary, dehydrate, noop } from '@tanstack/react-query' import { getQueryClient } from '@/app/get-query-client' import { getTodos } from '@/app/api/todos/data' import ApproachTabs from '@/components/ApproachTabs' export default function Home() { const queryClient = getQueryClient() void queryClient .query({ queryKey: ['todos'], queryFn: getTodos, }) .catch(noop) return (

Optimistic Updates with TanStack Query

Add todos to see optimistic updates in action. The server randomly fails ~30% of the time so you can observe automatic rollback.

) }