Nextjs Fundamentals · Next.js 16 Upgrade

Async Request APIs

`await params` / `cookies()` / `headers()`

Async Request APIs

Next.js 16 finishes a migration that began in version 15: the Request APIs are now asynchronous, and the synchronous access is fully removed. In page.tsx, layout.tsx, and route.ts, params and searchParams are Promises, and cookies() and headers() return Promises too.

Await them before you read anything:

// app/blog/[slug]/page.tsx
export default async function Page({ params, searchParams }) {
  const { slug } = await params;
  const query = await searchParams;
  return <h1>Blog Post: {slug}</h1>;
}

The same rule applies to the dynamic APIs:

import { cookies, headers } from 'next/headers';

export default async function Page() {
  const cookieStore = await cookies();
  const headerList = await headers();
  const theme = cookieStore.get('theme')?.value;
  return <p>{theme}</p>;
}

Because these values arrive asynchronously, the component that reads them must be async — and reading request data like this opts the route into dynamic rendering. The next-async-request-api codemod rewrites synchronous calls, and npx next typegen generates the PageProps and LayoutProps helpers so await props.params stays type-safe.

If you forget the await, you get a Promise instead of the value, so destructuring silently fails. Treat every one of these APIs as await-first.

You are about to answer a short quiz on await params / cookies() / headers().

  1. In Next.js 16, `params` and `searchParams` are Promises that you must await.
  2. A page reads its dynamic segment with `const { slug } = await ___;`.
  3. In Next.js 16, `cookies()` and `headers()` return Promises.
  4. Read the request cookies with `const cookieStore = await ___;`.
  5. Synchronous access to `params` and `cookies()` still works in Next.js 16.