File tree Expand file tree Collapse file tree
examples/nextjs-app/src/app Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -185,13 +185,16 @@ The package exports **`getInitialAppearanceScript()`** which returns a tiny scri
185185
186186``` tsx
187187// app/layout.tsx (Next.js App Router)
188+ import Script from " next/script" ;
188189import { getInitialAppearanceScript } from " @tailor-platform/app-shell/initial-appearance" ;
189190
190191export default function RootLayout({ children }) {
191192 return (
192193 <html lang = " en" suppressHydrationWarning >
193194 <head >
194- <script dangerouslySetInnerHTML = { { __html: getInitialAppearanceScript () }} />
195+ <Script id = " app-shell-initial-appearance" strategy = " beforeInteractive" >
196+ { getInitialAppearanceScript ()}
197+ </Script >
195198 </head >
196199 <body >{ children } </body >
197200 </html >
Original file line number Diff line number Diff line change 11import type { Metadata } from "next" ;
2+ import Script from "next/script" ;
23import { Geist , Geist_Mono } from "next/font/google" ;
34import { getInitialAppearanceScript } from "@tailor-platform/app-shell/initial-appearance" ;
45import "@tailor-platform/app-shell/styles" ;
@@ -28,7 +29,9 @@ export default function RootLayout({
2829 < html lang = "en" suppressHydrationWarning >
2930 < head >
3031 { /* Apply stored appearance before paint to avoid FOUC + hydration warnings. */ }
31- < script dangerouslySetInnerHTML = { { __html : getInitialAppearanceScript ( ) } } />
32+ < Script id = "app-shell-initial-appearance" strategy = "beforeInteractive" >
33+ { getInitialAppearanceScript ( ) }
34+ </ Script >
3235 </ head >
3336 < body className = { `${ geistSans . variable } ${ geistMono . variable } antialiased` } > { children } </ body >
3437 </ html >
You can’t perform that action at this time.
0 commit comments