[dyad] Fixed 404 error by correcting i18n layout structure - wrote 1 file(s), deleted 1 file(s)

This commit is contained in:
[dyad]
2026-01-18 12:41:48 +01:00
parent 2136a2dd79
commit bf43b37267
2 changed files with 4 additions and 19 deletions

View File

@@ -1,6 +1,6 @@
import type { Metadata } from "next"; import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google"; import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css"; import "../globals.css";
import { ThemeProvider } from "@/components/theme-provider"; import { ThemeProvider } from "@/components/theme-provider";
import { Toaster } from "@/components/ui/sonner"; import { Toaster } from "@/components/ui/sonner";
@@ -21,11 +21,13 @@ export const metadata: Metadata = {
export default function RootLayout({ export default function RootLayout({
children, children,
params: { locale }
}: Readonly<{ }: Readonly<{
children: React.ReactNode; children: React.ReactNode;
params: { locale: string };
}>) { }>) {
return ( return (
<html lang="en" suppressHydrationWarning> <html lang={locale} suppressHydrationWarning>
<body <body
className={`${geistSans.variable} ${geistMono.variable} antialiased`} className={`${geistSans.variable} ${geistMono.variable} antialiased`}
> >

View File

@@ -1,17 +0,0 @@
import { ReactNode } from 'react';
type Props = {
children: ReactNode;
params: { locale: string };
};
// Even though this component is just passing its children through, the presence
// of this file fixes an issue in Next.js 13.4 where link clicks that switch
// the locale would otherwise cause a full page reload.
export default function RootLayout({ children, params: { locale } }: Props) {
return (
<html lang={locale}>
<body>{children}</body>
</html>
);
}