0
Challenge · 13Data & Reads

React.use() in Client Components

Data fetchingused in ~72% of apps

In Next.js 16 a page's `params` is a Promise. A Server Component just `await`s it — but a Client Component can't be `async`, so `await params` is a compile error. The replacement everyone gets half-right is `use(params)`: it unwraps the promise, but it does it by suspending, not by returning `undefined` while it loads. Misunderstand that one detail and you ship a flickering page or an infinite loading spinner.

Core idea. `use()` is a React API that reads a resource — a Promise or a Context — during render. Given a Promise, it doesn't return a pending value; it suspends the component (handing control to the nearest `<Suspense>`) and resumes with the resolved value once it settles. It's how Client Components consume the promises (like `params` and `searchParams`) that Server Components would normally `await`.
Playground, this isn't a screenshot
Where do the Suspense boundaries go?
<Suspense fallback={<Spinner/>}><PanelA /></Suspense>
<Suspense fallback={<Spinner/>}><PanelB /></Suspense>
<Header />static — never suspends
Suspense
<PanelA />fast data
loaded
Suspense
<PanelB />slow data
loaded

One boundary per panel = independent reveals. Each panel shows its own spinner and pops in the moment it is ready — the slow panel no longer holds the fast one hostage. The header sits outside both boundaries, so it never disappears.

↑ play a little first, then dig in