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 Script from "next/script";
|
||||
import { Cormorant_Garamond, Plus_Jakarta_Sans } from "next/font/google";
|
||||
import {NextIntlClientProvider} from 'next-intl';
|
||||
import {getMessages, setRequestLocale} from 'next-intl/server';
|
||||
@@ -48,14 +49,13 @@ export default async function LocaleLayout({
|
||||
|
||||
return (
|
||||
<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>
|
||||
<NextIntlClientProvider messages={messages}>
|
||||
{children}
|
||||
</NextIntlClientProvider>
|
||||
|
||||
{/* VPS Panel Analytics */}
|
||||
<Script src="https://panel.ayris.tech/api/analytics/script" data-domain="http://menu.moybeachakyaka.com" strategy="afterInteractive" />
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user