Skip to content

Commit

Permalink
feat(v2): not found catch-all (#363)
Browse files Browse the repository at this point in the history
  • Loading branch information
QuiiBz authored Feb 18, 2024
1 parent 7de5659 commit 637c2f9
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 8 deletions.
5 changes: 5 additions & 0 deletions examples/app/app/[locale]/[...notFound]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { notFound } from 'next/navigation';

export default function NotFound() {
notFound();
}
13 changes: 5 additions & 8 deletions examples/app/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import { I18nProvider, generateI18nStaticParams } from '@/locales';
import React from 'react';

export const generateStaticParams = generateI18nStaticParams();
export const dynamicParams = false;
export function generateStaticParams() {
return generateI18nStaticParams();
}

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body>
<I18nProvider>{children}</I18nProvider>
</body>
</html>
);
return <I18nProvider>{children}</I18nProvider>;
}
13 changes: 13 additions & 0 deletions examples/app/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
}
10 changes: 10 additions & 0 deletions examples/app/app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';

export default function NotFound() {
return (
<div>
<h2>Custom Not Found page</h2>
<p>Could not find requested resource</p>
</div>
);
}

0 comments on commit 637c2f9

Please sign in to comment.