fix: use next/script for analytics to prevent hydration errors
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
|
import Script from "next/script";
|
||||||
import { Cormorant_Garamond, Plus_Jakarta_Sans } from "next/font/google";
|
import { Cormorant_Garamond, Plus_Jakarta_Sans } from "next/font/google";
|
||||||
import {NextIntlClientProvider} from 'next-intl';
|
import {NextIntlClientProvider} from 'next-intl';
|
||||||
import {getMessages, setRequestLocale} from 'next-intl/server';
|
import {getMessages, setRequestLocale} from 'next-intl/server';
|
||||||
@@ -48,14 +49,13 @@ export default async function LocaleLayout({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<html lang={locale} className={`${cormorant.variable} ${jakarta.variable} h-full`}>
|
<html lang={locale} className={`${cormorant.variable} ${jakarta.variable} h-full`}>
|
||||||
<head>
|
|
||||||
{/* VPS Panel Analytics */}
|
|
||||||
<script defer src="https://panel.ayris.tech/api/analytics/script" data-domain="http://menu.moybeachakyaka.com"></script>
|
|
||||||
</head>
|
|
||||||
<body className="min-h-full flex flex-col antialiased" suppressHydrationWarning>
|
<body className="min-h-full flex flex-col antialiased" suppressHydrationWarning>
|
||||||
<NextIntlClientProvider messages={messages}>
|
<NextIntlClientProvider messages={messages}>
|
||||||
{children}
|
{children}
|
||||||
</NextIntlClientProvider>
|
</NextIntlClientProvider>
|
||||||
|
|
||||||
|
{/* VPS Panel Analytics */}
|
||||||
|
<Script src="https://panel.ayris.tech/api/analytics/script" data-domain="http://menu.moybeachakyaka.com" strategy="afterInteractive" />
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user