remove unnecessary defer from script

This commit is contained in:
Nathaniel Tampus
2023-04-10 16:54:49 +08:00
parent c1fb2e50cd
commit 72be4aa0aa

View File

@@ -50,9 +50,8 @@ export default function RootLayout({ children }: { children: React.ReactNode })
<Footer /> <Footer />
{/* not using <Script> from next/script since it executes too late */} {/* next/script issue: https://github.com/vercel/next.js/issues/43402 */}
<script <script
defer
id="load-theme" id="load-theme"
dangerouslySetInnerHTML={{ dangerouslySetInnerHTML={{
__html: `if (localStorage.theme === "dark" || (!("theme" in localStorage) && window.matchMedia("(prefers-color-scheme: dark)").matches)) { __html: `if (localStorage.theme === "dark" || (!("theme" in localStorage) && window.matchMedia("(prefers-color-scheme: dark)").matches)) {