Data Fetching and Async UI
Load server data the right way: avoid waterfalls, model loading and error states, use Suspense, use() and error boundaries, TanStack Query and race-free caching.
Almost every real app shows data that lives on a server: products, messages, a user's profile. Getting that data is asynchronous: you ask, you wait, and the answer may arrive late, arrive out of order, or fail. Topic 7.7 showed the basic recipe of fetching in an effect. This phase is the complete picture: where data loading should happen, how to design screens for every state of a request, and which React features and libraries make it reliable.
You'll compare the four ways React apps get data (effects, data libraries, route loaders and server components) and learn to spot request waterfalls. You'll design loading, error and empty states without layout jumps, then learn React's built-in async tools: Suspense boundaries, the React 19 **use() hook, and error boundaries**, including the React 19 root error callbacks.
Then you'll meet the tool most teams use for server data, TanStack Query (query keys, caching, staleTime vs gcTime, mutations and invalidation), and finish by building the core of such a library yourself: a tiny cache with request deduplication, stale-while-revalidate and protection against race conditions. Server Components and Next.js data fetching come in Phase 20.
Practise this phase
Hands-on exercises: write the code, see your page live, and press Check to have it tested automatically.