TanStack Query

A library for server state: it fetches, caches by query key, deduplicates requests, refetches stale data, retries failures and exposes loading and error states. Client state such as the cart belongs elsewhere.

Learn this concept

Lesson 4.8 · TanStack Query caching

Used in exercises

Exercise 4.10 · Restaurant list screen Exercise 4.11 · Restaurant menu screen Exercise 4.15 · Item configurator screen Exercise 4.16 · Cart screen Exercise 4.21 · Cart synchronization helper Exercise 4.22 · Restaurant search utilities