返回 CodeWhale
not-found.tsx
根目录 / web / app / not-found.tsx
1 import { defaultLocale } from "@/lib/i18n/config";
2 import { NotFoundRoute } from "@/components/route-state";
3 import LocaleLayout from "./[locale]/layout";
4
5 export { metadata } from "./[locale]/not-found";
6
7 /**
8 * Root not-found boundary. `[locale]/layout.tsx` calls `notFound()` for a first
9 * segment that is not a locale (`/wp-login.php`); a layout's own not-found
10 * boundary cannot catch what the layout throws, so the error lands here. The
11 * root layout renders no document, so this wraps the not-found state in the
12 * default locale's shell — nav, footer, and dictionary copy, like
13 * `/en/nonexistent` — instead of the framework's bare page.
14 */
15 export default function RootNotFound() {
16 return (
17 <LocaleLayout params={Promise.resolve({ locale: defaultLocale })}>
18 <div className="route-state">
19 <NotFoundRoute />
20 </div>
21 </LocaleLayout>
22 );
23 }
24
24 lines Plain Text