Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(v2): not found catch-all #363

Merged
merged 2 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
);
}
Loading