diff --git a/src/components/theme/theme-script.tsx b/src/components/theme/theme-script.tsx index aa8d4c2..ffd41ab 100644 --- a/src/components/theme/theme-script.tsx +++ b/src/components/theme/theme-script.tsx @@ -1,10 +1,19 @@ +import Script from "next/script"; + /** * Applies the stored theme before first paint. * - * This has to be a blocking inline script in . A React effect runs after - * hydration, by which point the browser has already painted the default theme - * and the user sees a white flash on every navigation to a dark board. There - * is no way to fix that from inside React. + * Has to be inline and before hydration. A React effect runs after hydration, + * by which point the browser has already painted the default theme and the + * user sees a white flash on every navigation to a dark board. + * + * Renders via `next/script` with `beforeInteractive` rather than a plain + * ` + ); } \ No newline at end of file