Skip to content

Update docs and examples for async params in Next.js 15 #1587

@ChristianIvicevic

Description

@ChristianIvicevic

Link to page

https://next-intl-docs.vercel.app/docs/getting-started/app-router/with-i18n-routing#layout

Describe the problem

The change required is pretty simple as it's just the following:

export default async function LocaleLayout({
  children,
- params: {locale},
+ params,
}: {
  children: React.ReactNode;
- params: {locale: string};
+ params: Promise<{locale: string}>;
}) {
+ const locale = (await params).locale;
// ...

The issue is that the docs wouldn't be correct for Next 14 if this diff was to be applied. As such I didn't want to open a PR straight away and wanted to start a conversation how to proceed here from a UX-perspective.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions