1
ReactIntermediate#state
Server state lives elsewhere, can go stale and needs caching, retries and invalidation. Client state is owned by the UI (open menus, form drafts) and is synchronous. Mixing them in one store causes most data bugs.
// server state -> TanStack Query
useQuery({ queryKey: ['todos'], queryFn: fetchTodos });
// client state -> useState
const [drawerOpen, setDrawerOpen] = useState(false);