Skip to main content
Used to render promise values with automatic error handling. <Await> expects to be rendered inside a <React.Suspense> boundary.

Type Declaration

Props

Promise<T> | T
required
Takes a Promise returned from a loader to be resolved and rendered.
React.ReactNode | AwaitResolveRenderFunction
When using a function, the resolved value is provided as the parameter:
When using React elements, useAsyncValue will provide the resolved value:
React.ReactNode
The error element renders instead of the children when the Promise rejects.
To provide a more contextual error, you can use the useAsyncError hook in a child component:
If you do not provide an errorElement, the rejected value will bubble up to the nearest route-level ErrorBoundary and be accessible via the useRouteError hook.

Examples

Basic Usage with Render Function

With useAsyncValue

With Error Handling

Multiple Deferred Values

Streaming with useAsyncError

Behavior

  • Must be rendered inside a <React.Suspense> boundary
  • Suspends rendering until the promise resolves
  • If the promise rejects and no errorElement is provided, the error bubbles to the nearest route ErrorBoundary
  • Works with streaming SSR to progressively enhance the page
  • Can be used multiple times for multiple deferred values

Use Cases

  • Slow data sources: Load fast data immediately and stream slow data later
  • Progressive enhancement: Show critical content first, load optional content in the background
  • Improved perceived performance: Don’t block the entire page for slow data
  • Waterfall prevention: Load multiple slow resources in parallel

Notes

  • The promise is automatically tracked - don’t create new promises on each render
  • Combine with streaming SSR for optimal performance
  • Use for non-critical data that doesn’t block page render
  • Critical data should still be awaited in the loader