Skip to content

Commit f128911

Browse files
committed
docs: Don't use LayoutProps just yet
1 parent 03ee87f commit f128911

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

docs/src/pages/docs/getting-started/app-router.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ To make your request configuration available to Client Components, you can wrap
132132
```tsx filename="app/layout.tsx" {7}
133133
import {NextIntlClientProvider} from 'next-intl';
134134

135-
export default async function RootLayout({children}: LayoutProps<'/'>) {
135+
type Props = {
136+
children: React.ReactNode;
137+
};
138+
139+
export default async function RootLayout({children}: Props) {
136140
return (
137141
<html>
138142
<body>

docs/src/pages/docs/routing/setup.mdx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,12 @@ import {NextIntlClientProvider, hasLocale} from 'next-intl';
145145
import {notFound} from 'next/navigation';
146146
import {routing} from '@/i18n/routing';
147147

148-
export default async function LocaleLayout({
149-
children,
150-
params
151-
}: LayoutProps<'/[locale]'>) {
148+
type Props = {
149+
children: React.ReactNode;
150+
params: Promise<{locale: string}>;
151+
};
152+
153+
export default async function LocaleLayout({children, params}: Props) {
152154
// Ensure that the incoming `locale` is valid
153155
const {locale} = await params;
154156
if (!hasLocale(routing.locales, locale)) {
@@ -200,10 +202,12 @@ import {hasLocale} from 'next-intl';
200202
import {notFound} from 'next/navigation';
201203
import {routing} from '@/i18n/routing';
202204

203-
export default async function LocaleLayout({
204-
children,
205-
params
206-
}: LayoutProps<'/[locale]'>) {
205+
type Props = {
206+
children: React.ReactNode;
207+
params: Promise<{locale: string}>;
208+
};
209+
210+
export default async function LocaleLayout({children,params}: Props) {
207211
const {locale} = await params;
208212
if (!hasLocale(routing.locales, locale)) {
209213
notFound();

0 commit comments

Comments
 (0)