not-found.js
The not-found file is used to render UI when the notFound
function is thrown within a route segment.
export default function NotFound() {
return (
<>
<h2>Not Found</h2>
<p>Could not find requested resource</p>
</>
);
}
Note:
not-found.js
currently only renders when triggered by thenotFound
function, we're working on support for catching unmatched routes.
not-found.js
components do not accept any props.