useAsyncError
最も近い <Await>
コンポーネントからの拒否値を返します。
import { Await, useAsyncError } from "@remix-run/react";
function ErrorElement() {
const error = useAsyncError();
return (
<p>Uh Oh, something went wrong! {error.message}</p>
);
}
<Await
resolve={promiseThatRejects}
errorElement={<ErrorElement />}
/>;
さらなるリソース
ガイド
API