本页还没有译文
本页 10 段还没译成简体中文,下面显示的是英文原文。useAsyncError
还没翻译译自英文(reactrouter.com)本页 10 段都还没译
useAsyncError
Framework Data
Summary
Returns the rejection value from the closest <Await>.
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 />}
/>;Signature
function useAsyncError(): unknownReturns
The error that was thrown in the nearest Await component
AI 翻译查看英文原文