% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/hooks.R
\name{Await}
\alias{Await}
\title{Await}
\usage{
Await(
  into = NULL,
  as = "children",
  resolveKey,
  selector = NULL,
  render = NULL,
  errorElement = NULL,
  fallback = NULL,
  ...
)
}
\arguments{
\item{into}{A component (HTML tag or \pkg{shiny.react}-based element)
that will receive the hook data as the specified prop.}

\item{as}{Character. The name of the component's prop to inject the hook
data into (by default \code{"children"} for text display, \code{"rows"} for
a data grid, \code{"value"} for an input).}

\item{resolveKey}{Character. The key in the loader's return value that holds
the promise (e.g. if the loader returns \code{\{ data: promise \}},
set \code{resolveKey = "data"}).}

\item{selector}{Character. Optional key to extract from the hook data object.
If \code{NULL} (the default), the entire data is passed. Dotted paths
like \code{"summary.title"} navigate nested objects.}

\item{render}{Optional \code{\link{JS}} function \code{(value) => ReactNode}
used in place of \code{into}/\code{as}. Mirrors the native React Router
pattern for cases where a single prop is not expressive enough (e.g.
\code{JS("v => `${v.first} ${v.last}`")}).}

\item{errorElement}{Element to render if the promise rejects.}

\item{fallback}{Element shown while the promise is pending. Defaults to a
plain \code{"Loading\u2026"} span.}

\item{...}{Additional props to pass to the component.}
}
\description{
\url{https://api.reactrouter.com/v7/functions/react-router.Await.html}
}
\details{
Renders \code{into} when a deferred loader promise resolves, injecting the
resolved value (or a \code{selector} from it) \code{as} a prop.
Use inside a \code{\link{Route}} whose \code{loader} returns an object
containing a promise (written via \code{\link{JS}}). In React Router v7,
simply return the object directly -- no \code{defer()} wrapper is needed.
}
