Docs Hub

🇮🇷
iran mirrors
LaravelLaravelLivewireLivewireAlpine.jsAlpine.jsNext.jsNext.jsVue.jsVue.jsZustandZustandNuxt.jsNuxt.jsFilamentFilament
BootstrapBootstrap
Nest.jsNest.js
ReactReact
Vite.jsVite.js
Tailwind CSSTailwind CSS

© 2026 Juza66 and Arash Fadaee

Docs Hub

🇮🇷 iran mirrors
AfterCacheLifeCacheTagCatchErrorConnectionCookiesDraft ModeFetchForbiddenGenerate Image MetadataGenerate MetadataGenerate SitemapsGenerate Static ParamsGenerate ViewportHeadersImage ResponseOverviewNext RequestNext ResponseNot FoundPermanentRedirectRedirectRefreshRevalidatePathRevalidateTagUnauthorizedUnstable CacheUnstable NoStoreUnstable RethrowUpdateTagUse Link StatusUse ParamsUse PathnameUse Report Web VitalsUse RouterUse Search ParamsUse Selected Layout SegmentUse Selected Layout SegmentsUserAgent
EdgeTurbopackOverview
GlossaryOverview
Overview
Docs Hub

The connection() function allows you to indicate rendering should wait for an incoming user request before continuing.

It's useful when a component doesn't use Request-time APIs, but you want it to be rendered at runtime and not prerendered at build time. This usually occurs when you access external information that you intentionally want to change the result of a render, such as Math.random() or new Date().

ts
filename="app/page.tsx" switcher

export default async function Page() {
  await connection()
  // Everything below will be excluded from prerendering
  const rand = Math.random()
  return <span>{rand}</span>
}
jsx
filename="app/page.js" switcher

export default async function Page() {
  await connection()
  // Everything below will be excluded from prerendering
  const rand = Math.random()
  return <span>{rand}</span>
}

Reference

Type

jsx
function connection(): Promise<void>

Parameters

  • The function does not accept any parameters.

Returns

  • The function returns a void Promise. It is not meant to be consumed.

Good to know

  • connection replaces unstable_noStore to better align with the future of Next.js.
  • The function is only necessary when dynamic rendering is required and common Request-time APIs are not used.

Version History

VersionChanges
v15.0.0connection stabilized.
v15.0.0-RCconnection introduced.