fix: fixed hydration errors by setting ids

moved scripts to body since beforeInteractive strategy ones will be placed in the head regardless, avoiding double render
This commit is contained in:
Christian Andolf
2025-06-30 13:28:05 +02:00
parent a0b0ed2544
commit 18cbd952b7
4 changed files with 42 additions and 29 deletions

View File

@@ -49,15 +49,6 @@ export default async function RootLayout(
<FontPreload />
<AdobeSDKScript />
<GTMScript />
<Script
strategy="beforeInteractive"
data-blockingmode="auto"
data-cbid="6d539de8-3e67-4f0f-a0df-8cef9070f712"
data-culture={params.lang}
id="Cookiebot"
src="https://consent.cookiebot.com/uc.js"
async={true}
/>
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
<Script id="ensure-adobeDataLayer">{`
window.adobeDataLayer = window.adobeDataLayer || []
@@ -90,6 +81,16 @@ export default async function RootLayout(
</ClientIntlProvider>
</SessionProvider>
</div>
<Script
strategy="beforeInteractive"
data-blockingmode="auto"
data-cbid="6d539de8-3e67-4f0f-a0df-8cef9070f712"
data-culture={params.lang}
id="Cookiebot"
src="https://consent.cookiebot.com/uc.js"
async={true}
/>
</body>
</html>
)