% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/hooks.R
\name{useAsyncError}
\alias{useAsyncError}
\title{useAsyncError}
\usage{
useAsyncError(
  into = NULL,
  as = "children",
  selector = NULL,
  render = 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{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{...}{Additional props to pass to the component.}
}
\description{
\url{https://api.reactrouter.com/v7/functions/react-router.useAsyncError.html}
}
\details{
Calls the \code{useAsyncError()} hook and injects the rejection reason
(or a \code{selector} from it) \code{as} a prop of the \code{into}
component. Must be rendered inside the \code{errorElement} of an
\code{\link{Await}} so the hook can pick up the rejected promise's error.
}
