@@ -8,7 +8,11 @@ If you want to support the `dir` attribute in your `<html>` tag, you'll need to
88
99``` tsx {3,6}
1010// app/[locale]/layout.tsx
11- export default function Layout({ children , params : { locale } }: { children: ReactElement , params: { locale: string } }) {
11+
12+ // If you are using Next.js < 15, you don't need to await `params`:
13+ // export default function Layout({ children, params: { locale } }: { children: ReactElement, params: { locale: string } }) {
14+ export default function Layout({ children , params }: { children: ReactElement , params: Promise <{ locale: string }> }) {
15+ const { locale } = await params
1216 const dir = new Intl .Locale (locale ).getTextInfo ().direction
1317
1418 return (
@@ -56,7 +60,10 @@ Then, use it instead of the native `Intl.Locale.prototype.getTextInfo` API:
5660// app/[locale]/layout.tsx
5761import Locale from ' intl-locale-textinfo-polyfill'
5862
59- export default function Layout({ children , params : { locale } }: { children: ReactElement , params: { locale: string } }) {
63+ // If you are using Next.js < 15, you don't need to await `params`:
64+ // export default function Layout({ children, params: { locale } }: { children: ReactElement, params: { locale: string } }) {
65+ export default function Layout({ children , params }: { children: ReactElement , params: Promise <{ locale: string }> }) {
66+ const { locale } = await params
6067 const { direction : dir } = new Locale (locale ).textInfo
6168
6269 return (
0 commit comments