From 159be16129c02b5d349b5117ab1e1b6dcd97173f Mon Sep 17 00:00:00 2001 From: Claudio Wunder Date: Wed, 29 Nov 2023 19:36:56 +0100 Subject: [PATCH] meta: made changes back --- app/[locale]/layout.tsx | 6 +++--- app/[locale]/not-found.tsx | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/[locale]/layout.tsx b/app/[locale]/layout.tsx index e0edcaf20be1d..61fdfd82e8b24 100644 --- a/app/[locale]/layout.tsx +++ b/app/[locale]/layout.tsx @@ -1,6 +1,6 @@ import { Analytics } from '@vercel/analytics/react'; import { Source_Sans_3 } from 'next/font/google'; -import { useLocale } from 'next-intl'; +import { getLocale } from 'next-intl/server'; import type { FC, PropsWithChildren } from 'react'; import BaseLayout from '@/layouts/BaseLayout'; @@ -17,8 +17,8 @@ const sourceSans = Source_Sans_3({ subsets: ['latin'], }); -const RootLayout: FC = ({ children }) => { - const locale = useLocale(); +const RootLayout: FC = async ({ children }) => { + const locale = await getLocale(); const { langDir, hrefLang } = availableLocalesMap[locale] || defaultLocale; diff --git a/app/[locale]/not-found.tsx b/app/[locale]/not-found.tsx index 34c2edd6288f8..15c704c55d4cc 100644 --- a/app/[locale]/not-found.tsx +++ b/app/[locale]/not-found.tsx @@ -1,3 +1,5 @@ +'use client'; + import { useTranslations } from 'next-intl'; import type { FC } from 'react';