Open ShotaroHirose59 opened 6 months ago
error.tsx ファイルを使用して、ルート セグメントの UI 境界を定義できます。 これは、予期しないエラーに対するキャッチオールとして機能し、ユーザーにフォールバック UI を表示できるようにします。
notFound は存在しないリソースを取得しようとするときに使用できる。 404 エラーを表示して、アクセスしようとしているリソースが見つからなかったことをユーザーに伝えることができる。
notFound()
関数でnot-found.tsxをレンダリングできる (サーバーコンポーネントでok)
notFoundはerror.tsxよりも優先される
Further reading あとでちゃんと見る
In the previous chapter, you learned how to mutate data using Server Actions. Let's see how you can handle errors gracefully using JavaScript's try/catch statements and Next.js APIs. https://nextjs.org/learn/dashboard-app/error-handling
Topic