fix(production) : prevent hydration and service failures

This commit is contained in:
2026-09-29 16:28:15 +07:00 Unverified
parent c6f0428aa7
commit 76478fe56d
6 changed files with 37 additions and 12 deletions
+2 -5
View File
@@ -1,5 +1,3 @@
import Script from "next/script";
const clientId = process.env.NEXT_PUBLIC_GOOGLE_ADSENSE_CLIENT_ID?.trim();
export function GoogleAdsense() {
@@ -8,10 +6,9 @@ export function GoogleAdsense() {
}
return (
<Script
id="google-adsense"
<script
async
src={`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${encodeURIComponent(clientId)}`}
strategy="lazyOnload"
crossOrigin="anonymous"
/>
);