Returns the rejection value from the closest <Await>.
<Await>
The error that was thrown in the nearest Await component
import { Await, useAsyncError } from "react-router";function ErrorElement() { const error = useAsyncError(); return ( <p>Uh Oh, something went wrong! {error.message}</p> );}// somewhere in your app<Await resolve={promiseThatRejects} errorElement={<ErrorElement />}/>;@public Copy
import { Await, useAsyncError } from "react-router";function ErrorElement() { const error = useAsyncError(); return ( <p>Uh Oh, something went wrong! {error.message}</p> );}// somewhere in your app<Await resolve={promiseThatRejects} errorElement={<ErrorElement />}/>;@public
framework
data
Returns the rejection value from the closest
<Await>.